home *** CD-ROM | disk | FTP | other *** search
/ Artworx CD [Amiga] / Artworx CD - Amiga Version (Weird Science) (1995).iso / stereograms / sirds-faq < prev    next >
Text File  |  1994-09-04  |  99KB  |  2,665 lines

  1. Stereogram FAQ 
  2. ***************
  3.  
  4.  
  5. Archive-name: Stereogram-FAQ
  6. Last-modified: July 7th, 1994 
  7. Changes-to: Stuart Inglis (singlis@cs.waikato.ac.nz)
  8.  
  9. Contents
  10. ========
  11.  
  12. General questions: 
  13. [1] What is a SIRDS/Stereogram/Hollusion/SIS?
  14. [2] Terminology 
  15. [3] How do I see them? Everyone else can see them....
  16. [4] Where can I buy the posters from? 
  17. [5] How can I generate them myself? 
  18. [6] Which books/papers should I read? 
  19. [7] What is a SIRTS/Ascii-Stereogram 
  20. [8] Where is most of the discussion about SIRDS? 
  21. [9] Internet locations for material (lots of pictures!)
  22. [10] Stereogram History 
  23.  
  24. Stereogram creation: 
  25. [21] How can I write my own programs?
  26. [22] Creation of SIS 
  27. [23] Multiple stereograms 
  28. [24] Losing the color 
  29. [25] C code for Windows 
  30. [26] Use POV-RAY to build depth images? NEW!
  31.  
  32. Miscellaneous/problems: 
  33. [41] Stereogram Anecdote 
  34. [42] Buying commercial programs 
  35. [43] The image I see is "inverted" or "sunk-in"! 
  36. [44] Call for stereograms 
  37.  
  38.  
  39. Subject: [1] What is a SIRDS/Stereogram/Hollusion/SIS?
  40. ======================================================
  41.  
  42. Have you walked through a mall lately? These days, as you wander
  43. past most of the poster shops, there will be a large group of
  44. people staring at the same poster with surprisingly weird
  45. expressions on their faces. Some will be in the initial stages of
  46. denial or rejection---they will be concentrating, some slowly
  47. rocking their heads backwards and forwards, searching for an
  48. image that they have never seen before. Others will be grinning
  49. from ear to ear, pointing at the poster, chuckling with their
  50. friends that a member of their group hasn't seem them yet.
  51. "Come on Bill, come on!", they cry and as Bill gets increasingly
  52. more frustrated he concentrates harder and harder, until finally (if
  53. he's lucky) he sees a true 3D image, without the need for special
  54. glasses or equipment.
  55.  
  56. These pictures are known as Single Image Random Dot
  57. Stereograms (SIRDS), or Single Image Stereograms (SIS) depending
  58. on whether the picture contains random dots as a base for the 3D
  59. effect, or a repetitive pattern. Unfortunately, each commercial
  60. company has labelled them differently. Shop owners generally
  61. don't know what you mean, unless you say "Hollusion" or one of
  62. the many other specific names.
  63.  
  64. Stereogram Mechanism
  65. ====================
  66.  
  67. -- Cristian Alb (luminita@poincare.mathappl.polymtl.ca)
  68.  
  69. Disclaimer:
  70. All the opinions and ideas presented in this [article] are mine and
  71. are the result of my own reflections on the subject.
  72.  
  73. Purpose:
  74. This document wants to provide an easy understanding of the
  75. mechanism of 3-D perception related to stereograms. Due to the
  76. fact that it is the result of genuine thinking, I hope that this
  77. document provides a more intuitive approach to the subject.
  78.  
  79. What is a stereogram ? 
  80.  
  81. In this document I refer to stereogram (though, single image
  82. stereogram would be more correct) as being something like the
  83. image that follows: 
  84.  
  85. /=-- Y+-z-/=-- Y+-z-/=-- Y+-z-/=-- Y+-z-/=-- Y+-z-/=-- Y+-z-/=-- Y+-z-/=-- Y+-z
  86.  *wm  @m@w *wm  @m@w *wm  @m@w *wm  @m@w *wm  @m@w *wm  @m@w *wm  @m@w *wm  @m@
  87. O@=*+z @:/O@=*+z @:/O@=*+z @:/O@=*+z @:/O@=*+z @:/O@=*+z @:/O@=*+z @:/O@=*+z @:
  88. :*/- :m: *:*/- :m: *:*/- :m: *:*/- :m: *:*/- :m: *:*/- :m: *:*/- :m: *:*/- :m: 
  89. )*/O@-Y|- )*/O@-Y)*/O@-Y)*/O@-Y)*/O@zO@)*/O@z zO@)*/O@zO@)*/O O@zO@*/O O@zwO@*/
  90. *):O*zO((@*):O*zO*):O*zO*):O*zO*):O*mO*z):O*mO(O*z):O*(O*z):+:O*(O*):+:O*()O*):
  91. m))@z@-+m~m))@z@-m))@z@-m))@z@-m))@z*@z@-m@z*@z@@@-m*@z@@@m@-m*@z@@m@-m*@z @@m@
  92. z:+*O-mm*Yz:+*O-mz:+*O-=O-mz:+*O-=O-mz:+*O--mz:+***-mz:+*)***-mz:+****-mz:-+***
  93. m@: @:~+( m@: @:~m@: @: @:~m@: @: @:~m@: @: @m@: @: @m@/@: @: @m@/@ @: @m@+/@ @
  94. -+(*m- o-)-+(*m- -+(*m-Om- -+(*m-Om- -+(*m-Om-+(*m-Om-+-+(*m-Om-+-+*m-Om-+|-+*m
  95. m*m  |== *m*m  |=m*m  |=m*m     |=m*m     |=m*m   |=m*m*m   |=m*m*m  |=m*m+*m  
  96. + YY/ + ) + YY/ ++ YY/ ++ YY/*Y/ ++ YY/*Y/ ++ Y*Y/ ++-+ Y*Y/ ++-+ YY/ ++-+* YY/
  97. zY=) w ~/YzY=) w zY=) w zY=) z) w zY=) z) w zY=z) w zmzY=z) w zmzY=) w zmz|Y=) 
  98. + oY*:+:ow+ oY*:++ oY*:m*:++ oY*:m*:++ oY*:m*:+oY*:m* *:+oY*:m* *:+Y*:m* *z:+Y*
  99. @ z++ *zo)@ z++ *@ z++ w+ *@ z++ w+ *@ z++ w+ *z++ w+ + *z++ w+ + *++ w+ +* *++
  100. ()=ww+  *O()=ww+ ()=ww+-w+ ()=ww+-w+ ()=ww+-w+ =ww+-w+w+ =ww+-w+w+ ww+-w+w=+ ww
  101. z     +wO z     +z     +  +z     +  +z     +  +    + =  +    + =  +   + = ( +  
  102. o +@~@= ozo +@~@=o +@~@+~@=o +@~@+~@=o +@~@+~@=+@~@+~@~@=+@~@+~@~@=@~@+~@~z@=@~
  103. )(w=++ +~z)(w=++ +~z)(w=++ +~z)(w=++ +~z)(w=++ +~z)(w=++ +~z)(w=++ +~z)(w=++ +~
  104. mz- O @  =mz- O @  =mz- O @  =mz- O @  =mz- O @  =mz- O @  =mz- O @  =mz- O @  
  105.  
  106. If you stare at this image by trying to focus on something behind
  107. the image, you will be able to see, after some-time, a 3-D scene
  108. with the letters F Y I detaching from the background. (If you read
  109. this document on a monitor it is easier to focus on your image
  110. reflected on the screen in order to get the 3-D illusion. If you
  111. read this document on paper, try to put a glass in front of it and
  112. do the same thing.) 
  113.  
  114. To understand the mechanism which allows you to get this
  115. peculiar effect, we should take a look at the process of vision. 
  116.  
  117. The feeling of "depth" that you get by looking at a statue instead
  118. of looking at a photo of the same statue, is due to the fact that
  119. the human body has two eyes.
  120.  
  121. In the above example with the statue, we need just one eye to get
  122. the general shape of the statue. A humble photo does the same. It
  123. is the second eye that provides some "extra" information. This
  124. extra information is the "depth" of the various parts of the statue.
  125. In fact a "photo" gives just a bi-dimensional (x,y) representation,
  126. to get the third dimension (z) you need some "extra". 
  127.  
  128.                 y
  129.                  |       |---------
  130.                  |    z  | Photo  |
  131.                  |    /  |        |
  132.                  |  /    ---------|
  133.                  |/_______ x
  134.  
  135. By having two pictures of the same object, taken by two different
  136. positions, which is the case of the human eyes, you can get the
  137. "z" coordinate to that object. It is a simple geometrical question. 
  138.  
  139. In fig.1 we assume that there are 2 objects, X and Y which are at
  140. the same height (y) and different depths (z) and positions (x) 
  141.  
  142. |------------------------------------------------------------|  
  143. |                                                     Fig.1  |    
  144. |                                              z             |   
  145. |                                         y    |             |  
  146. |                    Y                      \  |             |    
  147. |                                             \|_____x       |   
  148. |                                                            |    
  149. |                                                            |   
  150. |                                                            |   
  151. |                                                            |    
  152. |                                                            |   
  153. |                  X                             ^           |   
  154. |                                                |           |    
  155. |                                                |           |    
  156. |                                                |           |   
  157. |                      (o)     (o)                           |   
  158. |                                             watching       |    
  159. |                  left-eye  right-eye        direction      |   
  160. |                                              (depth)       |   
  161. |------------------------------------------------------------|   
  162.  
  163. In fig.2 are shown the kind of "pictures" that each eye gets: 
  164.  
  165. (fig.2L -left eye, fig.2R -right eye; the '+' marks the center of each
  166. picture) 
  167.  
  168. |------------------------------| |-----------------------------|
  169. |                       Fig.2L | |                      Fig.2R |
  170. |                              | |                             |
  171. |                              | |                             |
  172. |                              | |                             |
  173. |        X Y +                 | |    X       Y   +            |
  174. |                              | |                             |
  175. |                              | |                             |
  176. |                              | |                             |
  177. |                              | |                             |
  178. |------------------------------| |-----------------------------|
  179.  
  180. As you can notice the 'X' shifts more than the 'Y' from one
  181. picture to another. This is an indication that the X object is
  182. 'closer' than Y. 
  183.  
  184.    shift.X = d.hrz.right ( X, '+') - d.hrz.left ( X, '+') 
  185.  
  186.    shift.Y = d.hrz.right ( Y, '+') - d.hrz.left ( Y, '+') 
  187.  
  188. where "dx.hrz.hhh ( A, '+')" means distance (on the horizontal
  189. axis) in the hhh picture from object A to origin/center. 
  190.  
  191. Furthermore, with good approximation we can say that any
  192. objects with the same 'shift' are at the same "depth" (z) 
  193.  
  194. In the same way, the eyes forward to the brain two slightly
  195. different pictures. It is the brain that must "compute" a 3-D
  196. representation of the scene. The difficulty is to know which pairs
  197. must be associated to "compute" the z-coordinate. In the example
  198. above it's easy to assume that the 'X' from each picture is
  199. associated to one 'X' object. The same goes for the two 'Y'. But
  200. the images that the brain gets to compute, can be quite
  201. complicated. What if there are more X-s and Y-s in each picture ?
  202. How does the brain establish the "couples" for which to calculate
  203. the shift/depth ? A clue is that each pair must be on the same
  204. height (y). Which means that the brain should not try to associate
  205. spots, patterns that are located at different heights. But that is
  206. not enough ! 
  207.  
  208. The 'brain' can make mistakes in this process of designation of
  209. pairs! It is that which make possible the 3-D feeling that we get
  210. from stereograms. 
  211.  
  212. The simplest stereogram that we can get is something like-this: 
  213.  
  214.        
  215. _______________________________________________________________ 
  216. |     *         *         *         *         *         *     |
  217. |     *         *         *         *         *         *     |
  218. |     *         *         *         *         *         *     |
  219. |     *         *         *         *         *         *     |
  220. |     *         *         *         *         *         *     |
  221. |     *         *         *         *         *         *     |
  222. |     *         *         *         *         *         *     |
  223. |     *         *         *         *         *         *     |
  224. |     *         *         *         *         *         *     |
  225. |     *         *         *         *         *         *     |
  226. |     *         *         *         *         *         *     |
  227. |     *         *         *         *         *         *     |
  228. |     *         *         *         *         *         *     |
  229. |     *         *         *         *         *         *     |
  230. |     *         *         *         *         *         *     |
  231. |     *         *         *         *         *         *     |
  232. |     *         *         *         *         *         *     |
  233. |     *         *         *         *         *         *     |
  234. |-------------------------------------------------------------|
  235. Column:1        2         3         4         5         6        
  236.  
  237. Using the same procedure as in the beginning of this document
  238. you should be able to see the same '*' columns but "somewhere
  239. behind" this document. 
  240.  
  241. In fig.3 (Left/Right) I have represented the kind of pictures that
  242. the eyes forward to the brain when looking at the preceding
  243. stereogram. (notice '+', the center) 
  244.  
  245. |-------------------------------| |-----------------------------|
  246. |   :    :    :    :    :Fig.3L | |:    :    :    :    : Fig.3R |
  247. |   :    :    :    :    :    :  | |:    :    :    :    :    :   |
  248. |   :    :    :    :    :    :  | |:    :    :    :    :    :   |
  249. |   :    :    :    :    :    :  | |:    :    :    :    :    :   |
  250. |   :    :   +:    :    :    :  | |:    :    :    :    +    :   |
  251. |   :    :    :    :    :    :  | |:    :    :    :    :    :   |
  252. |   :    :    :    :    :    :  | |:    :    :    :    :    :   |
  253. |   :    :    :    :    :    :  | |:    :    :    :    :    :   |
  254. |   :    :    :    :    :    :  | |:    :    :    :    :    :   |
  255. |-------------------------------| |-----------------------------|
  256. column:
  257.     1L   2L   3L   4L   5L   6L    1R   2R   3R   4R   5R   6R
  258.  
  259. Normally the brain will associate the columns in the following
  260. way:
  261.  
  262.    1L-1R, 2L-2R, 3L-3R, 4L-4R, 5L-5R, 6L-6R 
  263.  
  264. but it can happen that the brain does the following association:
  265.  
  266.    1L-2R, 2L-3R, 3L-4R, 4L-5R, 5L-6R, ?-1R, 6L-?
  267.  
  268. Remember: All columns look alike ! 
  269.  
  270. Of course it is possible that the brain makes other associations of
  271. these kinds:
  272.  
  273.    1L-3R, 2L-4R, 3L-5R,... or 2L-1R, 3L-2R, 4L-3R,... etc.
  274.  
  275. but in these cases the resulting 3-D representations makes no
  276. sense, or are very little alike. 
  277.  
  278. It can be noticed that by choosing a diferent association of
  279. columns the "shift" between the images of the objects changes.
  280. As a result the "depth" of the perceived objects changes. In the
  281. association 1L-2R, 2L-3R,... the shift is reduced -> the "depth"
  282. increases -> the columns seem somewhere behind. 
  283.  
  284. Is it possible to determine exactly the power of the brain in
  285. matching complicated images ? I thought, some time ago, what
  286. would happen if we put someone in front of a large panel situated
  287. at a convenient distance (so that the eyes are relaxed) and the
  288. panel is full of randomly disposed spots. The spots should be all
  289. alike and in very great number, very small but big enough to not
  290. became a uniform gray. The brain should be overwhelmed by the
  291. great number of matches that it must try. What will happen ? The
  292. person will get dizzy ? get a headache ? Or will the person be
  293. forced to see just a gray fog ? 
  294.  
  295.  
  296. Subject: [2] Terminology
  297. ========================
  298.  
  299. Different types of images: 
  300.    Autostereogram: Original name for a SIRDS 
  301.    RDS: Random Dot Stereogram 
  302.    SIRDS: Single Image Random Dot Stereogram 
  303.    SIRTS: Single Image Random TEXT Stereogram (also known
  304.    as ascii stereograms) 
  305.    Stereogram: This is a general, simplified term for SIRDS and
  306.    SIRTS (occasionally stereo-pairs)
  307.  
  308. Different viewing actions: 
  309.    Wall-eyed: Converging eyes past the actual image 
  310.    Cross-eyed: Converging in front of the image 
  311.    Infinity-focus: Forcing your eyes' lines of sight to be parallel
  312.    (not necessary for wall-eyeing SIRDS)
  313.  
  314.  
  315.  
  316. Subject: [3] How do I see them?
  317. ===============================
  318.  
  319. Most Stereogram pictures are usually generated so that if you look
  320. at (converge your eyes on) a position twice as far away as the
  321. picture, and focus on the picture, generally after a few minutes
  322. you see a surprising 3D image!
  323.  
  324. Most people find this extremely difficult for the first time. You
  325. have to focus on a point which is different from where you are
  326. looking. This is known as "de-coupling" your vision process.
  327. Instinctively people focus at the same point they are looking at,
  328. and this is the main obstacle in seeing images of this type.
  329.  
  330. This is why most posters come with a reflective surface such as
  331. glass or plastic covering them---if you try to look at your
  332. reflection you will be looking at a point twice as far away as the
  333. actual poster. It has been noted by almost everyone that while
  334. this sometimes helps beginners see the 3D effect for the first
  335. (and perhaps even the first few) times, experienced viewers to not
  336. need any help like this, and indeed the reflection is usually very
  337. distracting and decreases the quality of the 3D effect.
  338.  
  339. There are many ways to teach this de-coupling to either yourself
  340. or to others, including (in almost no particular order):
  341.  
  342. NOTE: It is generally easier to see Stereograms under bright light.
  343. I have been told this is because you eye relies less on focus under
  344. harsh conditions. Another point, to see stereo images, you need
  345. to have "passable" use of both eyes. If you wear glasses try with
  346. and without them on. Some short-sighted people can see them
  347. easier without their glasses on (if they get closer to the picture). 
  348.  
  349. The pull-back 
  350.  
  351. Hold the picture (or move your face) so your nose is touching the
  352. picture. Most people than can not possibly focus with something
  353. this close to their eyes, and they will be content with their
  354. inability to focus. With the picture up close, pretend that you are
  355. looking straight ahead, right through it. Now slowly pull the
  356. picture (or your face) away while keeping your eyes pointed
  357. straight ahead. If you do this slow enough, an image usually
  358. appears when the picture is at the correct distance.
  359.  
  360. The reflection 
  361.  
  362. As mentioned above, with a reflective surface it is sometimes a lot
  363. easier to converge your eyes in the correct position. You simply
  364. focus on your nose or some central reflection in the picture, and
  365. wait until you focus on the image. 
  366.  
  367. The drunk-eyes 
  368.  
  369. This method is used to describe the feeling of the process of
  370. deconverging your eyes. It is very much like being drunk or having
  371. "staring-eyes". Your eyes don't look at the object, but rather
  372. through it. This state is common to some in the morning before
  373. the coffee caffine fix.
  374.  
  375. The wall, or the finger 
  376.  
  377. Hold the picture so that it is half between you and a wall. Look
  378. *over* the top of the picture towards the wall, and focus on
  379. something such as a picture hook or mark. While keeping this
  380. "gaze" either slowly lift the picture or lower your eyes while
  381. keeping them converged on the wall. 
  382.  
  383. A similar approach (but for cross-eyed viewing) is to stand arm's
  384. length away from the picture and put your finger on the picture.
  385. While slowly pulling your finger towards your face, keep looking
  386. at your finger, you will notice the picture becoming blurry, and at
  387. an intermediate position you will (eventually) see the 3D image.
  388.  
  389. The see-through 
  390.  
  391. Photocopy the picture onto a transparency. Then focus through
  392. the transparency onto something twice as far away. This is similar
  393. to (The wall, or the finger) above except now you don't need to
  394. change the position of your gaze.
  395.  
  396. Wide-Eyes 
  397.  
  398. This method involves building a device to widen your interocular
  399. distance, as well as allowing the adjustment of the convergence of
  400. your eyes. It's so simple, you almost don't have to be there!. I
  401. have had a look through such a device, and the results were very
  402. good. 
  403.  
  404. (diagram pending...) 
  405.  
  406. Cheating... 
  407.  
  408. To cheat, photocopy the image onto two transparencies, then
  409. overlay them and carefully shift them horizontally so they are
  410. about an inch or two out of alignment. Somewhere around this
  411. position you will see a rendition of the image. Obviously in 2D not
  412. 3D, but you will at last finally believe there is "somethere in
  413. there."
  414.  
  415. And if you're still having difficulty, this comment by
  416. jhakkine@cc.Helsinki.FI (Jukka Hakkine), may apply to you:
  417. "Richards (1970; Experimental Brain Research 10, 380-388) did a
  418. survey among 150 MIT students and noticed that "...about 4% of
  419. the students are unable to use the cue offered by disparity, and
  420. another 10% have great difficulty and incorrectly report the depth
  421. of a Julesz figure relative to background." He further concludes
  422. that inability to use stereopsis is an inherited defect and is related
  423. to "three-pool"-hypothesis of binocular neurons." 
  424.  
  425. But don't dispair, don't give up until you're tried for at least a
  426. month! 
  427.  
  428.  
  429.  
  430. Subject: [4] Where can I buy the posters from?
  431. ==============================================
  432.  
  433. For those who do not have a local SIRDS distributor (i.e., the
  434. poster cart at the mall), here are a few companies you may be able
  435. to order from.
  436.  
  437. ------------- Infix Technologies -------------
  438. ++++++++++++++++++++++++++++++++++++++++++++++
  439.  
  440. $20 Earth (mercator projection of the Earth's altitudes)
  441. $20 Salt Lake LDS Temple Centennial 
  442. $20 Beethoven (300 DPI! Very smooth.) 
  443.  
  444. These prints are 18x24 inches. Retail price for the 18x24 inch
  445. prints is $20 plus $3 s/h. Utah residents add 6.25% sales tax.
  446. Wholesale and distributor discounts are available. Quotes for
  447. custom work are also available. Cost and minimum order varies,
  448. based on content.
  449.  
  450. PO Box 381 
  451. Orem, UT 84057-0381,USA 
  452. Ph: (801) 221-9233 
  453. email: John M. Olsen (jolsen@nyx.cs.du.edu)
  454.  
  455. ------------- Inner Dynamics, Inc. -------------
  456. ++++++++++++++++++++++++++++++++++++++++++++++++
  457.  
  458. (Distributors) 
  459. Privileged Traveler 
  460. 4914 Brook Road 
  461. Lancaster, OH 43130, USA 
  462. (614) 756-7406
  463.  
  464. Glow in the Dark Poster Series - $22 (size: 18" X 24") 
  465.  
  466. "Knight Vision" - suspended chess board with chess pieces above
  467. the board in daylight viewing; also an area in the center that has a
  468. Knight chess piece; random dot pattern glows and is viewable in
  469. the dark!! 
  470.  
  471. Premium Color Series - $16 (size: 18" X 24") 
  472.  
  473. "Gecko" - twin Gecko lizards 
  474. "I Think Therefore I Am" - well known quote surrounded by
  475. stunning visuals 
  476. "SoulMate" - hearts, spirals, and other symbols, for that special
  477. person 
  478. "The Mighty Unicorn" - unicorn, mystical castle, wizard, and
  479. flying dragon 
  480. "Excalibur" - legendary sword in the stone, castle, knights, etc. 
  481. "Where's Wilbur?" - can you find him in the forest? 
  482.  
  483. Optimum Series - $15 (size: 24" X 36") (black and white) 
  484.  
  485. "Beyond Reality" - hearts, spirals, other cool shapes; extremely
  486. detailed 
  487. "20/20 Third Sight" - an eye chart done in 3D 
  488. "Illusions" - a labyrinth, try to find your way out! 
  489. "Meditation" - contains an ancient mandala, a real stress buster 
  490. "DreamWeaver" - unusual geometric shapes, `helps' induce lucid
  491. dreaming and dream remembrance 
  492. "Icons" - the five symbols of life; very stunning visuals 
  493. "Rainbows" - see color on a black and white poster (Not a 3D
  494. poster) 
  495.  
  496. Retail prices (USA) stated above plus $3 S&H (USA) - call for
  497. overseas S&H. Ohio residents add 5.5% sales tax.
  498.  
  499. ------------- Altered States -------------
  500. ++++++++++++++++++++++++++++++++++++++++++
  501.  
  502. 92 Turnmill St,
  503. Farringdon,
  504. London, EC1, U.K.
  505. +44 (0)71 490 2342
  506. Paul Dale (P.A.Dale@bath.ac.uk)
  507. tel: +44 (0)225 826 215
  508.  
  509. ------------- N.E. Thing Enterprises -------------
  510. ++++++++++++++++++++++++++++++++++++++++++++++++++
  511.  
  512. Send a catolog request to:
  513. N.E. Thing Enterprises
  514. 19C Crosby Drive
  515. Bedford, MA 01730, USA.
  516. -- info from: Neal T. Leverenz (at802@yfn.ysu.edu) 
  517.  
  518.  
  519. Subject: [5] How can I generate them myself?
  520. ============================================
  521.  
  522. There are many fine programs for generating SIRDS out there in
  523. the Internet. The following programs are available from 
  524. ftp://katz.anu.edu.au/pub/stereograms(IP 150.203.7.91). Here is a
  525. list of the ones I currently know about:
  526.  
  527. Acorn 
  528.    mindimg 
  529. PC 
  530.    3DRANDOT 
  531.    ANIM - 3D animation, in 3D 
  532.    DYNAMIC 
  533.    HIDIMG - SIS as well as SIRDS. You can use a pattern, save
  534.    BMP files 
  535.    MINDIMG - Stereopairs (red/blue, red/green) as well as
  536.    SIRDS 
  537.    PERSPECT 
  538.    RDSDRAW 
  539.    SHIMMER - making it easier to see SIRDS 
  540.    SIRDSANI 
  541.    SIRDSVU11 
  542.    VUIMG340 
  543. Mac 
  544.    random-dot-autostereograms 
  545. Unix/X 
  546.    xpgs - 3D objects 
  547.    rle2pgm - converts the popular MINDIMG format to PGM 
  548.    RaySIS - SIS raytracer 
  549.  
  550.  
  551.  
  552. Subject: [6] Which books/papers should I read?
  553. ==============================================
  554.  
  555. Books 
  556. ======
  557.  
  558. "Stereogram"
  559. (c) 1994, Cadence Books, P.O. Box 77010, San Francisco, CA 94107,
  560. USA.
  561. A newly edited version of CG STEREOGRAM and CG STEREOGRAM
  562. 2,
  563. published by Shogakukan Inc. In Tokyo, Japan"
  564. ISBN 0-929279-85-9
  565. US$ 12.95 
  566. I liked it. Much better in my opinion than the other Stereogram
  567. book I've seen ("Magic Eye"). This one includes much textual
  568. information, including the origins of stereograms, how to see them,
  569. precursors such as stereo pairs, and an article by Christopher W.
  570. Tyler, who invented the SIRDS. Best of all were the stereograms
  571. themselves. There are roughly 50 SIRDS, most of them full page
  572. (the book is softcover and about 8" square). The ones I've managed
  573. to see so far have been quite good, and also included are some of
  574. the very first ones. In the history department there are stereo pairs,
  575. stereo photographs, and even some stereo-pair paintings by
  576. Salvador Dali. All of the stereograms indicate whether they require
  577. wall-eyed or cross-eyed viewing (or either). Most are true 3d
  578. designs, not the "cutout" variety. The book is 93 pages and most of
  579. the plates are full-color. Well worth the money in my opinion. 
  580. -- Michael Moncur (mgm@xmission.com)
  581. I highly recommend the new book "Stereogram" by Cadence books,
  582. ISBN #0-929279-85-9 (in Canada). It is a fantastic book that
  583. includes hundreds of stereograms, stereo pictures, RDS's, lots of
  584. very interesting writeups on the history of stereograms, a cool
  585. section on Salvador Dali (stereo pair aritst). The concentration of
  586. course is on the pictures. The book is just under 100 pages. Much
  587. better value then Magic Eye. It's even got some cool cross-eyed
  588. only viewing stereograms, which I'd never seen before this (I'd
  589. always used the other technique). If you have *any* interest in
  590. stereograms, buy this book, you won't regret it!! At $17 Cdn, it's
  591. not that much either, considering the amount of time you'll spend
  592. revelling in the 3d inside.
  593. -- Ian Sewell (3386005@queensu.ca)
  594.  
  595. "Principles of Cyclopean Perception" 
  596. (c) 1972 by Bela Julesz, 
  597. MIT press. Considered by most as the original work oPn Random
  598. Dot Stereograms: 
  599. -- Charles Eicher (CEicher@Halcyon.com)
  600.  
  601. "Magic Eye: A New Way of Looking at the World" 
  602. (c) 1993 by N.E. Thing Enterprises. 
  603. Andrews and McMeel, A Universal Press Syndicate Company
  604. Kansas City, USA. ISBN: 0-8362-7006-1
  605. First Printing, September 1993 ... Fifth Printing, January 1994
  606. Introduction contains a history of the technique and phenomena.
  607. Viewing Techniques are explained. 25 pages of full-color
  608. STARE-E-O images. (Plus images inside the front and back covers.)
  609. "Answers" included. 32 pages, hardcover, 8.75x11.5 inches,
  610. horizontal format, with slipcover.
  611. US$12.95 ($16.95/Canada)
  612.  
  613. "Magic Eye II: Three Dimension Trip Vision"
  614. (c) 1992 by N.E. Thing Enterprises/Tenyo Co., Ltd.
  615. Korean Translation (c) 1993 by Chungrim Publishing Co.
  616. All the text is in Korean, so I can't read it. But it has some pretty
  617. cool pictures. They are all SIRxS where x is various
  618. patterns/pictures. I paid US$20 for it. Interestingly, this title doesn't
  619. seem to be mentioned in my N.E. Thing catalog.
  620. -- Mark Hudson (M_Hudson@delphi.com)
  621. They've taken the technique a step further by applying the
  622. pseudo-random patterns as noise superimposed over another
  623. image. You look at the pages of this book and see one image, then
  624. cross your eyes and concentrate on the replicated patterns in the
  625. background noise and see the second image. It's kinda cute.
  626. -- Robert Reed 
  627.  
  628. "Das magische Auge" (German version of "Magic Eye")
  629. (c) 1994, arsEdition, Munich
  630. ISBN 3-7607-8297-3
  631. DM 29,- (seen at a store for this price)
  632.  
  633. "Stereo Computer Graphics and Other True 3D Technologies" 
  634. (c) 1993, David F. McAllister, Ed.
  635. Princeton University Press
  636. ISBN 0-691-08741-5 US$75.00
  637. It has several nice color plates, with stereo "triads". The triads
  638. consist of a left, a right, then another left image. Use the left pair
  639. for viewing walleyed, or the right pair for viewing crosseyed.
  640. -- Mike Weiblen (mew@digex.net)
  641.  
  642. "Random Dot Stereograms"
  643. (c) 1993, Kinsman Physics, P.O. Box 22682, Rochester, NY
  644. 14692-2682, USA.
  645. An excellent source of information (sample RDS and source code)
  646. -- Eric Thompson (E.Thompson@ncl.ac.uk)
  647. ISBN 0-9630142-1-8 
  648. US$ 13.95
  649.  
  650. "Human Stereopsis. A psychological Analysis"
  651. (c) 1976, W.L. Gulick and R.B. Lawson, 
  652. Oxford University Press.
  653.  
  654. Papers 
  655. =======
  656.  
  657. B. Julesz and J.E. Miller, (1962) "Automatic stereoscopic
  658. presentation of functions of two variables" Bell System Technical
  659. Journal, 41: 663-676; March.
  660.  
  661. R.I. Land and I.E. Sutherland, (1969) "Realtime, color, stereo,
  662. computer displays" Applied Optics, 8(3): 721-723; March
  663.  
  664. D. Marr and T. Poggio, (1976) "Cooperative computation of stereo
  665. displarity" Science, 194: 283-287; October 15
  666.  
  667. D. Marr and T. Poggio, (1979) "A computational theory of human
  668. stereo vision" Proceedings Royal Society of London, B204: 304-328
  669. Science, 194: 283-287; October 15
  670.  
  671. G.S. Slinker and R.P. Burton, (1992) Journal of Imaging Science and
  672. Technology, 36(3): 260-267; May/June
  673.  
  674. D. G. Stork and C. Rocca, (1989) "Software for generating
  675. auto-random-dot stereograms", Behavior Research Methods,
  676. Instruments, and Computers 21(5): 525-534.
  677.  
  678. H.W. Thimbleby and C. Neesham, (1993) "How to play tricks with
  679. dots" New Scientist, 140(1894): 26-29; October 9
  680.  
  681. H.W. Thimbleby, S.J. Inglis, and I.H. Witten, (1994) 
  682. ftp://ftp.cs.waikato.ac.nz/pub/SIRDS (IP 130.217.240.3), in press. 
  683.  
  684. C.W. Tyler and M.B. Clarke, (1990) "The Autostereogram" SPIE
  685. Stereoscopic Displays and Applications 1258: 182-196
  686.  
  687. C. Wheatstone, (1838) "Contributions to the physiology of vision.
  688. Park I. On some remarkable, and hitherto unobserved, phenomena
  689. of binocular vision" Royal Society of London Philosophical
  690. Transactions 128: 371-394
  691.  
  692. C. Wheatstone, (1838) "Contributions to the physiology of vision.
  693. Park II. On some remarkable, and hitherto unobserved,
  694. phenomena of binocular vision (continued)" The London,
  695. Edinburgh, and Dublin Philisophical Magazine and Journal of
  696. Science, series 4, 3: 504-523
  697.  
  698.  
  699.  
  700. Subject: [7] SIRTS/Ascii Stereograms
  701. ====================================
  702.  
  703. For people without graphics displays, or simply like having a 3D
  704. .signature, you can create a stereo effect using repetitive
  705. characters.
  706.  
  707. Text Stereograms (not random)
  708.  
  709. -- the following by Dave Thomas (dthomas@bbx.basis.com)
  710.  
  711.                             O   O
  712. n   n   n   n   n   n   n   n   n   n   n   n   n   n   n  n
  713. f    f    f    f    f    f    f    f    f    f    f    f   f
  714. e   e   e   e   e   e   e   e   e   e   e   e   e   e   e  e
  715. a    a    a    a    a    a    a    a    a    a    a    a   a
  716. a   a   a   a   a   a   a   a   a   a   a   a   a   a   a  a
  717. r    r    r    r    r    r    r    r    r    r    r    r   r
  718. r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r
  719.  
  720.  
  721.  
  722.  
  723.  g  g  g  g  g  g  g  g  g  g  g  g  g  g  g  g  g  g  g  g  
  724.    r   r   r   r   r   r   r   r   r   r   r   r   r   r   r 
  725.  e    e    e    e    e    e    e    e    e    e    e    e    
  726.  a     a     a     a     a     a     a     a     a     a     
  727.    t      t      t      t      t      t      t      t      t    
  728. >>><<<<>>>><<<<>>>><<<<>>>><<<<>>>><<<<>>>><<<<>>>><<<<>>>><<
  729.    d      d      d      d      d      d      d      d      d    
  730.  e     e     e     e     e     e     e     e     e     e     
  731.  p    p    p    p    p    p    p    p    p    p    p    p    
  732.    t   t   t   t   t   t   t   t   t   t   t   t   t   t   t 
  733.  h  h  h  h  h  h  h  h  h  h  h  h  h  h  h  h  h  h  h  h  
  734.  
  735.  
  736.  
  737. -- the next few are by DR J (me90drj@brunel.ac.uk)
  738. Look for his new upcoming Text Stereogram Guide---out soon!
  739.  
  740.  
  741.      /^\           /^\           /^\           /^\           /^\
  742.  ####################################################################
  743.  ####################################################################
  744.  _/    ####    _/   ####\    _/  #### \    _/ ####  \    _/####   \
  745. /       ## \__/      ##  \__/     ##   \__/    ##    \__/   ##     \
  746.    ____ ##     ____  ##    ____   ##   ____    ##  ____     ## ____
  747.   /    \##    /    \ ##   /    \  ##  /    \   ## /    \    ##/    \
  748.  |  2D  |#   |  2D  |##  |  2D  | ## |  2D  |  ##|  2D  |   #|  2D  |
  749.  |  or  |#   |  or  |##  |  or  | ## |  or  |  ##|  or  |   #|  or  |
  750.  |  3D  |#   |  3D  |##  |  3D  | ## |  3D  |  ##|  3D  |   #|  3D  |
  751.  |  ??  |#   |  ??  |##  |  ??  | ## |  ??  |  ##|  ??  |   #|  ??  |
  752.  |      |    |      |    |      |    |      |    |      |    |      |
  753.  --------    --------    --------    --------    --------    --------
  754.   \\\\\\\\    \\\\\\\\    \\\\\\\\    \\\\\\\\    \\\\\\\\    \\\\\\\\
  755.    \\\\\\\\    \\\\\\\\    \\\\\\\\    \\\\\\\\    \\\\\\\\    \\\\\\\\
  756.      \\\\\\      \\\\\\      \\\\\\      \\\\\\      \\\\\\      \\\\\\
  757.  
  758.  
  759.  
  760.          /^\              /^\              /^\              /^\
  761.      _  /   \        _   /   \       _    /   \      _     /   \     _
  762.     / \_     \_     / \_/     \_    / \_ /     \_   / \_  /     \_  / \_
  763.    /    \      \   /    \       \  /    \        \ /    \          /    \
  764. __/      \      __/      \      __/      \      __/      \      __/      \
  765.   xx      \    /xx        \   xx  \       \ xx /  \       xx   /  \     xx
  766. x XX     x \_ x XX \    x   x XX   \   x  x XX     \  x x XX _/    \  x XX
  767. X XX-x-x-XxX--X XX-x--x-XxX-X XX-x---x-XxXX XX-x----x-XxX XX-x-----x- X XX
  768. XxXX X XxX    XxXX X  XxX   XxXX X   XxX  XxXX X    XxX XxXX X     Xx XxXX
  769.   XXxX __X      XXxX  __X     XXxX   __X    XXxX    __X   XXxX     __   XX
  770.   XX            XX            XX            XX            XX            XX
  771. __XX      ______XX      ______XX      ______XX      ______XX      ______XX
  772.  
  773. (Cactii modified from a drawing by Chris Pirillo) 
  774.  
  775.  
  776.  
  777.  
  778.   \ .       \   .     \     .   \       . \        .\         \.
  779.    \  .      \.   .    \ .    .  \  .     .\   .     \.   .    \  .  .
  780.    \\    .   \\     .  \\      . \\       .\\        \\        \\
  781.     \\     .  \\      . \\       .\\        \\        \\        \\.
  782.      \\.       \\ .      \\  .     \\   .    \\    .   \\     .  \\
  783.       *  .      *   .     *    .    *     .   *      .  *       . *
  784.              .          .          .          .          .          .
  785.         .            .            .            .            .
  786.         .   .      .    .     .     .    .      .   .       .  .
  787.           .           .           .           .           .           .
  788.     . .        .  .       .   .      .    .     .     .    .      .   .
  789.  
  790.   ___/~\_/\____/~\_/\____/~\_/\____/~\_/\____/~\_/\____/~\_/\____/~\_/\_
  791.   _/~~\_   _/~~\_   _/~~\_   _/~~\_   _/~~\_   _/~~\_   _/~~\_   _/~~\_
  792.  
  793.  
  794.  
  795.  
  796.   .                 .                 .                 .              
  797.           .                .                .                .
  798.       +               +               +               +               +
  799.      .                 .                 .                 .           
  800.            *                 *                 *                 *
  801.    .                .                .                .                
  802.        .                 .                 .                 .
  803.               +                +                +                +
  804.   *                  *                  *                  *
  805.               .                 .                 .                 .
  806.     .                .                .                .               
  807.           .                 .                 .                 .
  808.          +              +              +              +              +
  809.                .                .                .                .
  810.       .                 .                 .                 .
  811.           *                 *                 *                 *
  812.   .                .                .                .                .
  813.            .                 .                 .                 .
  814.          +              +              +              +              +
  815.                .                .                .                .
  816.            *                 *                 *                 *
  817.        .                 .                 .                 .
  818.   *                  *                  *                  *
  819.           .                 .                 .                 .
  820.     .                .                .                .               
  821.              +               +               +               +
  822.  
  823.  
  824.  
  825.  
  826.                 .           '            .           '
  827.         .            '   *       .            '   *       .
  828.               .                        .                        .
  829.                     .         '              .         '
  830.           _'   ____________________ '  ____________________  ' _
  831.           |____|~~         _      |____|~~         _      |____|
  832.                    _                       _
  833.                   '          =            '          =
  834.                                    /                     /
  835.                 .     --      ,.. /     .     --    ,.. /
  836.                             ,`   ';               ,`   ';
  837.                  .,.__    _,' /';  .   .,.__    _,' /';  .
  838.                .:','  ~~~~    '. '~  .:','  ~~~~    '. '~
  839.                :' (   )   .   ; ):;. :' (   )   .   ; )::;.
  840.                '. '. .=----=..-~ .;' '. '. .=----=..-~  .;'
  841.                 '  ;' ::    ':. '"    '  ;'  ::   ':.  '"
  842.           ~~~~~~  (:  ': ~   ;) ~~~~~~~ (:   ':  ~ ;)  ~~~~~~~~~
  843.           '~       \\  '"   ./  '~       \\   '"  ./   '~
  844.                ~    '"      '"       ~    '"      '"       ~
  845.  
  846.  
  847.  
  848.  
  849. Subject: [8] Where is most of the discussion about SIRDS?
  850. =========================================================
  851.  
  852. Most of the discussion about SIRDS has taken place in alt.3d . A
  853. lot of people would like to see the death of SIRDS, both due to the
  854. overwelming number of people asking FAQ's, and simply because
  855. there is much *much* better 3D out there than this!
  856.  
  857. Usually people post requests for information to newsgroups such
  858. as comp.graphics...unfortunately these people sometimes get
  859. flamed, get told it is *impossible* to draw them...if this has
  860. happened to you read alt.3d , viva la difference.
  861.  
  862.  
  863.  
  864. Subject: [9] Internet locations for material
  865. ============================================
  866.  
  867. Newsgroups 
  868.    alt.3d newsgroup 
  869.    (most SIRDS discussion is in this group)
  870.  
  871. Ftp sites 
  872.    ftp://katz.anu.edu.au/pub/stereograms (IP 150.203.7.91) 
  873.    (currently the definitive site)
  874.  
  875.    ftp://ftp.amu.edu.pl/pub/chemia/steroskopia (IP
  876.    150.254.65.7)
  877.  
  878.    ftp://gwaihir.dd.chalmers.se/pub/een/SIS (IP 129.16.117.21) 
  879.    (SIRDS in TIFF graphic format)
  880.  
  881.    ftp://sunsite.unc.edu/pub/academic/computer-science/virtual-reality/3d
  882.    (IP 152.2.22.81) 
  883.    (anaglyph programs, older archive of alt.3d)
  884.  
  885.    ftp://techno.stanford.edu/pub/raves/visuals/graphics/pc/stereogram
  886.    (IP 36.73.0.71) 
  887.  
  888. Web pages 
  889.    http://www.cs.waikato.ac.nz/~singlis/sirds.html 
  890.    (SIRDS-FAQ location)
  891.  
  892.    http://acacia.ens.fr:8080/home/massimin/index.ang.html 
  893.    (contains lots of extremely nice pictures)
  894.  
  895.    http://h2.ph.man.ac.uk/gareth/sirds.html 
  896.    (Picture Gallery, organised by Chang and Richards, home of
  897.    xpgs and SIRDSANI)
  898.  
  899.    http://www.cs.uidaho.edu/staff/hart.dir/sirds 
  900.    (Vern's SIRDS Gallery) 
  901.  
  902.  
  903.  
  904. Subject: [10] Stereogram History
  905. ================================
  906.  
  907. -- Robert Raymond, Mirages -- Moab, Utah
  908. Last updated: 28-June-1994 with comments from Jukka Hakkinen
  909. (jhakkine@cc.helsinki.fi)
  910.  
  911. 1960 
  912.    Julesz, B. Binocular depth perception of computer generated
  913.    patterns. Bell Systems Technical Journal 39, 1125-1162.
  914.    (First article considering RDSs) 
  915. 1962 
  916.    Julesz, B. and Miller, J. E. (1962) Automatic stereoscopic
  917.    presentation of functions of two variables. Bell System
  918.    Technical Journal. 41:663-676; March. Thimbleby (1990)
  919.    refers to this article: "Julesz and Miller were the first to
  920.    show clearly that a sense of depth could arise purely from
  921.    stereopsis, without relying on other cues such as
  922.    perspective or contours. they used random patterns of dots
  923.    which, although meaningless to single eye viewing,
  924.    nevertheless created a depth impression when viewed in a
  925.    stereoscope." 
  926.  
  927.    The following additional information about Julesz seems to
  928.    be from The Magic Eye, 1993, N.E. Thing Enterprises,
  929.    Andrews and McMeel. I found it quoted in a newspaper
  930.    article: 
  931.  
  932.    During the 1960s, a researcher named Bela Julesz was the
  933.    first to use computer-generated 3-D images made up of
  934.    randomly placed dots to study depth perception in human
  935.    beings. Because the dot pictures did not contain any other
  936.    information, like color or shapes, he could be sure that
  937.    when his subject saw the picture it was 3-D only. 
  938.  
  939.    In the years that followed, other people continued using
  940.    random dot pictures in their work; many of them were
  941.    graduate students who studied with Julesz. With time they
  942.    found new and better ways to create these interesting
  943.    illusions. 
  944. 1963 
  945.    Julesz, B Stereopsis and binocular rivalry of contours.
  946.    Journal of Optical Society of America 53, 994-999. (First
  947.    article which was accepted in a major US journal) 
  948. 1964 
  949.    Julesz, B. Binocular depth perception without familiarity
  950.    cues. Science 145, 356-363. (First paper which was accepted
  951.    in a major international journal) 
  952. 1965 
  953.    Bela Julez, "Textured and Visual Perception," Scientific
  954.    American, Feb. 1965. An article on stereo dot pictures.
  955.    [George J Valevicius] 
  956. 1966 
  957.    N. A. Valyus. Stereoscopy. Focal Press, London and New
  958.    York. 426 pp. (I have not seen this book, but Boyer,1990
  959.    refers to it to say that Stereographic paintings are almost
  960.    beyond possibility.) 
  961. 1968 
  962.    Bela Julez. "Experiment in Perception," Psychology Today,
  963.    July 1968. Cover story with a full page graphic and a few
  964.    smaller ones. 
  965. 1971 
  966.    Bela Julesz. Foundations of Cyclopean Perception. Chicago:
  967.    Univ. of Chicago Press. I have not seen this book, but
  968.    Kinsman,1992 mentions it: "Julesz (1971) describes
  969.    photographic techniques producing random dot stereograms
  970.    in use in the early 1950s.... Since Julesz, in 1960, was the
  971.    first to employ a computer to generate random dot
  972.    stereograms, many would consider him the person most
  973.    responsible for their popularity today.... Anaglyphs of
  974.    random dot stereograms... are presented in the back of
  975.    Julesz's book, and a pair of the (half-red/half-green) glasses
  976.    required to view them is tucked inside the back cover." 
  977. 1966 
  978.    Julesz, B. Binocular disappearance of monocular symmetry.
  979.    Science 153, 657-658. (Disparity cues can be more powerful
  980.    than monocular from cues) 
  981. 1971 
  982.    Dr. Bela Julesz in "Reading from Scientific American -
  983.    Image, Object and Illusion" by W.H. Freeman Publisher ISBN
  984.    0-7167-0505-2 (1971). [Bob Easterly] 
  985. 1976 
  986.    Marr, D. and Poggio, T. (1976), Cooperative computation of
  987.    stereo disparity, Science, 194:283-287; October 15.
  988.    Thimbleby (1990) refers to this article: "[They] discuss
  989.    computational models of the visual processes that are
  990.    involved in interpreting random dot stereograms." 
  991. 1977 
  992.    Bela Julesz. Foundations of Cyclopean Perception. University
  993.    of Chicago Press, Chicago. xiv, 406 pp. I assume this is the
  994.    same book as the 1971 book referenced by (Kinsman,1992). I
  995.    think Boyer gave the wrong publication date. Of the book,
  996.    Boyer writes: 
  997.  
  998.    "The random-dot stereogram is a very inspiring
  999.    demonstration of the sophistication and complexity of the
  1000.    information-processing which occurs in everyday human
  1001.    vision.... The first extensive studies of random-dot
  1002.    stereograms were accomplished by Bela Julesz and his
  1003.    colleagues on large and expensive computers, using
  1004.    professional programmers, at the Bell telephone
  1005.    Laboratories." (Boyer,1990) 
  1006. 1977 
  1007.    Tyler & Chang, Vision Research, #17. Referenced by Tyler,
  1008.    1983. 
  1009. 1979 
  1010.    Marr, D. and Poggio, T. (1979), A computational theory of
  1011.    human stereo vision, Proceedings Royal Society of London,
  1012.    B204, 304:328. Thimbleby (1990) refers to this article: "[They]
  1013.    discuss computational models of the visual processes that
  1014.    are involved in interpreting random dot stereograms." 
  1015. 1983 
  1016.    Schor & Cuiffreda, editors. Vergence Eye Movements: Basic &
  1017.    Clinical Aspects. One chapter, by Christopher Tyler
  1018.    including genuine SIRDS. Interestingly, he doesn't say he
  1019.    invented them. He just calls them "a new type of
  1020.    autostereogram designed for free fusion without the need
  1021.    for a stereoscope or anaglyph glasses". Then he says the
  1022.    basis is the repetition of a random pattern and refers to
  1023.    Tyler & Chang, 1977, Vision Res, #17. [Dan Richardson] 
  1024. 1985 
  1025.    Paul S. Boyer. Stereographic technique for illustrating
  1026.    geologic specimens. New Jersey academy of Science, Bulletin,
  1027.    volume 39, no. 2, pp. 83-91. I have not seen this article, but
  1028.    Boyer,1990 refers to it when speaking of the DIN 4531
  1029.    stereogram format. 
  1030. 1986 
  1031.    L. L. Kontsevich. "An Ambiguous Random-Dot Stereogram
  1032.    Which Permits Continuous Changing of Interpretation,"
  1033.    Vision Research, Vol. 26, No. 3, pp. 517-519. I have not seen
  1034.    this article, but Kinsman,1992 mentions it: "Kontsevich
  1035.    (1986) describes a technique for making a series of tiles."
  1036.    Kinsman presents a "similar stereogram" that is a SIRDS. If
  1037.    so, this would be the first SIRDS I am aware of. 
  1038. 1987 
  1039.    Paul S. Boyer. Constructing true stereograms on the
  1040.    Macintosh. The Journal of Computers in Mathematics and
  1041.    Science Teaching, volume 6, no. 2, pp. 15-22. (I have not
  1042.    seen this article, but Boyer,1990 refers to it as a detailed
  1043.    article describing computer stereography.) 
  1044. 1988 
  1045.    Falk, Brill and Stork produce the "Seeing The Light" image
  1046.    that Dyckman referenced in his Stereo World article. [Dan
  1047.    Richardson] 
  1048. 1988 
  1049.    J. Ninio and I. Herlin. "Speed and Accuracy of 3D
  1050.    Interpretation of Linear Stereograms, Vision Research, Vol.
  1051.    28, No. 11, pp. 1223-1233. I have not seen this article, but
  1052.    Kinsman,1992 mentions it: "Ninio and Herlin (1988), and
  1053.    Slinker and Burton (1992), experimented with stereograms
  1054.    containing complex patterns [triangles, lines, blotches, and
  1055.    even images] in their initial noise fields." 
  1056. 1989 
  1057.    Rocca and Stork, Behavior Research Methods, Instruments
  1058.    and Computers, 1989, might be vol 21 number 5.
  1059.    Demonstrats a little Mac program they wrote to generate
  1060.    SIRDS from MacPaint files. [Dan Richardson] 
  1061. 1990 
  1062.    Paul S. Boyer, Professor of Geology, Fairleigh Dickinson
  1063.    University, "Random-Dot Stereograms -- Creating a
  1064.    Psychological Phenomenon," STEREO WORLD, March/April
  1065.    1990. Creating SIRDS on the Mac. 
  1066. 1990 
  1067.    Tyler, C. W. and Clarke, M. B. (1990) The autostereogram.
  1068.    SPIE Stereoscopic Displays and Applications 1258: 182-196.
  1069.    Thimbleby (1990) refers to this article: "Recently, however,
  1070.    Tyler and Clarke realized that a pair of random dot
  1071.    stereograms can be combined together, the result being
  1072.    called a single image random dot stereogram (SIRDS) or,
  1073.    more generally, an autostereogram.... [They] described a
  1074.    simple but asymmetric altorithm, which meant, for example,
  1075.    that some people can only see the intended effect when the
  1076.    picture is held upside-down." 
  1077. 1990 
  1078.    Dan Dyckman, "Single Image Random Dot Stereograms,"
  1079.    STEREO WORLD, May/June 1990. "I was recently surprised
  1080.    when a friend of mine ... showed me a
  1081.    random-dot-stereograph that consisted fo a single image,
  1082.    rather than the usual stereo pair. To view the image, one
  1083.    fused two marks within the image, and would see the words
  1084.    SEEING THE LIGHT." 
  1085.  
  1086.    "Interested readers might consider creating poster-sized
  1087.    images using this technique, or experimenting with
  1088.    supplementary gray-level or color values for each pixel. And,
  1089.    if any reader knows who invented this technique for single
  1090.    image random dot sstereograms, or who created the SEEING
  1091.    THE LIGHT image, please drop a note to this magazine." 
  1092. 1991 
  1093.    Prior to June 1991 a company named Pentica Systems, Inc
  1094.    (One Kendall Square, Building 200, Cambridge, MA 02139,
  1095.    Tel. 617-577-1101, Tom Baccei - President) published an
  1096.    advertisment, "Pentica Loves Puzzles," with a SIRDS image in
  1097.    it. The magazine may have been EDN--I don't remember. 
  1098. 1991 
  1099.    About June 3, 1991, Pentica mails an information packet to
  1100.    those responding to the add. In the information Pentica sent
  1101.    to those responding to the ad, they say, "We discovered ...
  1102.    the technique for generating it in STEREO WORLD." Four
  1103.    SIRDSs accompany the information, marked "images (c) 1990
  1104.    by Dan Dyckman." 
  1105. 1991 
  1106.    June 13, 1991, N.E. Thing Enterprises, (One Kendall Square,
  1107.    Building 200, Cambridge, MA 02139) also mails a flyer to
  1108.    those responding to the Pentica ad. The N.E.Thing address
  1109.    and the Pentica address are the same, as well as the postal
  1110.    meter number (FMETER 8010560) for the two mailings. The
  1111.    flyer states, "from the people who created the Pentica Loves
  1112.    Puzzles Ad.... Because of the unbelievably enthusiastic
  1113.    response to our random dot stereogram featured in the
  1114.    'Pentica Loves Puzzles' ad, we are rushing you this advance
  1115.    notice of our latest 3D mindbenders." They offered 3
  1116.    posters, World's Hardest Maze, The Third Eye, Training
  1117.    Wheels, and a 1992 Calendar. 
  1118. 1992 
  1119.    Andrew A. Kinsman, Random Dot Stereograms, Kinsman
  1120.    Physics, 1992. First printing October 1992. "This history of
  1121.    the stereogram is a bit elusive. It appears to be intertwined
  1122.    with anaglyphs, lenticular photographs, and stereoscopic
  1123.    photographic techniques. Charles Wheatstone described
  1124.    stereoscopy in 1832. In 1851 the the London Society of Arts
  1125.    held the Crystal Palace Exhibition, which six million people
  1126.    attended and potentially witnessed Sir David Brewster
  1127.    demonstrate the stereoscope. Stereoscopes became popular
  1128.    as a result. Kahn (1967), in The Codebreakers, references an
  1129.    article by Herbert C. McKay, written in the late 1940s, on
  1130.    how to manufacture simple stereograms with a typewriter
  1131.    for encryption purposes.... Julesz (1971) describes
  1132.    photographic techniques producing random dot stereograms
  1133.    in use in the early 1950s. History seems to have recorded no
  1134.    particular inventor of stereograms. It is quite probable that
  1135.    soon after parlor-style stereoscopes became popular
  1136.    someone took a photograph of a camouflaged hunter with a
  1137.    stereo camera. The subject in the resulting picutre might be
  1138.    difficult to identify. Viewed stereoscopically with the rest of
  1139.    their collection, the subject would become obvious." 
  1140. 1992 
  1141.    "This unique synthesis of computer technology and fine art
  1142.    began simply as an idea between two creative individuals in
  1143.    1992. Paul's art background and Mike's computer genious
  1144.    proved to be the perfect combination of talents. Several
  1145.    hundred man hours later, in a remote region of California,
  1146.    came the first public exposure to Holusion(TM) 3D Prints.
  1147.    And so NVision Grafix was born." (NVision Grafix flyer
  1148.    introducing Calypso Reef, 1993.) "Micro Synectic was Mike
  1149.    Bielinski is NVision...NE Thing and Micro Synectics are listed
  1150.    in the StareEO demo, because Mike Bielinski wrote it for NE
  1151.    Thing." (CompuServe messages from Dan Richardson) "The
  1152.    images are the creation of NVision Grafix, a Texas-based
  1153.    firm owned by two former fraternity brothers, Paul Herber
  1154.    and Mike Bielinski. They developed the Holusion technology
  1155.    while making a poster of the B-2 bomber for the company
  1156.    where Herber worked as an engineer. The posters were a
  1157.    huge hit, and soon, Herber and Bielinski had abandoned
  1158.    their jobs to start up NVision: Herber is the artist, and
  1159.    Bielinski is the computer whiz.... As NVision has grown,
  1160.    though so has it's competition. Computer expert Tom Baccei
  1161.    has created his won "high-tech, three-dimensional art form"
  1162.    under the name "Magic Eye" and is marketing the images on
  1163.    books, posters, calendars, puzzles and cards." (Nicole
  1164.    Brodeur, Orange County Register. As reprinted in The Daily
  1165.    Herald, March 22, 1994) 
  1166. 1993 
  1167.    N.E. Thing begins patent process on several RDS algorithms.
  1168.    "Salitsky dot" algorithm and the algorithm to produce an
  1169.    RDS that looses it's colors when viewed in 3D are apparently
  1170.    two algorithms. I have not seen the patent applications, but
  1171.    the law requires that they discuss "prior art." If someone
  1172.    could get copies of these applications, it would not only
  1173.    describe the algorithms in detail, it would present a history
  1174.    of SIRDS, to the degree that N.E. Thing was aware. 
  1175. 1993 
  1176.    Harold W. Thimbleby, Stuart Inglis, and Ian H. Witten,
  1177.    "Displaying 3d Images: Algorithms for Single Image Random
  1178.    Dot Stereograms," University of Waikato, Hamilton, New
  1179.    Zealand, published on the Internet. I believe Stuart
  1180.    mentioned it was being published in an IEEE journal in 1994.
  1181.    I've forgotten which one and when. [IEEE Computer, soon -
  1182.    S.] 
  1183.  
  1184. -- A few historical comments by jhakkine@cc.helsinki.fi
  1185. There was a good article about the early history of RDSs in Vision
  1186. Research (Julesz (1986), Vision Research vol. 26 no. 9, 1601-1612).
  1187. Julesz who himself was a radar engineer tells that the first RDS
  1188. was accidentally taken by a photographic Spitfire flying over
  1189. Cologne in 1940! (The picture has been published by Smith
  1190. (Perception 1977, vol.6, 233-234)). The picture consists of some
  1191. city blocks, a bridge and the river Rhine which is covered by ice.
  1192. Because the ice is floating downriver and the pictures are taken at
  1193. slightly different times, the ice patterns are slightly different in
  1194. two stereopairs. This results a depth parallax between the
  1195. pictures and when they are stereoscopically fused there seems to
  1196. be a deep valley in the middle of the river. This caused great
  1197. confusion in the wartime RAF but no-one could make up an
  1198. explanation to the phenomenon because at the time there was no
  1199. knowledge about stereoscopic processes working without
  1200. monocular pattern recognition. 
  1201.  
  1202. Julesz also mentions that there had been some prior attempts to
  1203. make RDSs (Aschenbrenner, C.M. (1954) Problems in getting
  1204. information into and out of air photographs. Photogramm.Engng.
  1205. 20, 398-401) but without a noticeable succes because the pictures
  1206. had been hand cut. Because the methods had been so crude there
  1207. was a good possibility that these pre-RDSs contained monocular
  1208. depth cues. Julesz created his stereograms with a computer so
  1209. they were very precise and the possibility of monocular cues was
  1210. nonexistent. Naturally the leading researchers at the time (Ogle &
  1211. Wakefield (1967) Vision Research vol.7, 89-98) did not believe that
  1212. it was possible and the notion of depth perception without
  1213. monocular cues remained controversial for a long time. 
  1214.  
  1215. Ogle & Wakefield (1967):
  1216. "One obtains the impression from some of Julesz's interesting
  1217. experiments that certain targets yield a stereoscopic depth, but
  1218. contours cannot be perceived monocularly. However, the
  1219. stereoscopic depth experienced in the central portion is that of a
  1220. defined square proximal or distal to the background, determined
  1221. precisely by the "lines" he "cut" in the background patterns of
  1222. random details in each of the stereogram pairs. It is difficult to
  1223. believe that a "cut" and displacement of random patterns - unless
  1224. the details of patterns are exceedingly small - result in a
  1225. randomness on the two sides of the cut. Some of the dots could
  1226. have been split. It may be true that monocularly the contours may
  1227. be difficult to perceive, but still we wonder if they are not
  1228. perceivable." 
  1229.  
  1230.  
  1231.  
  1232. Subject: [21] How can I write my own programs?
  1233. ==============================================
  1234.  
  1235. There are several approaches to take to write a SIRDS program
  1236. (we'll start with SIRDS and move on to SIS in the next section).
  1237.  
  1238. We have some facts that will help us write the program: 
  1239.  
  1240.  o We need two objects (pixels) for stereo vision (ie. 2 eyes) 
  1241.  o Eye convergence (where we look) informs us of it's 3D depth
  1242.  
  1243. To make a SIRDS we have to make sure (for each 3D point in the
  1244. object) we have two pixels the same colour (say either black or
  1245. white) at a particular distance apart, so that when we "look
  1246. through" each of the pixels, we will see the corresponding pixel in
  1247. 3D. 
  1248.  
  1249. To calculate the relationship between the pixels is the *only*
  1250. complicated stage. We use an array called 'same[]' which simply
  1251. points to a pixel (in the same scan line) that has the same value.
  1252.  
  1253. The second "for x" loop does this. At each position in the object,
  1254. calculate the dot separation, calculate where the left and right line
  1255. of sight will intersect the image, and shuffle the array so there is
  1256. a one to one link.
  1257.  
  1258. After we have this 'same[]' array we simply iterate over the array,
  1259. picking a colour and propagating it's colour across the bitmap.
  1260. And then the process is finished, the result: a Single Image
  1261. Random Dot Stereogram.
  1262.  
  1263. #define round(X) (int)((X)+0.5) 
  1264. #define DPI 72                  
  1265. #define E round(2.5*DPI)        
  1266. #define mu (1/3.0)              
  1267. #define separation(Z) round((1-mu*Z)*E/(2-mu*Z))
  1268. #define far separation(0)       
  1269. #define maxX 256                
  1270. #define maxY 256
  1271.  
  1272. void DrawAutoStereogram(float Z[][]) 
  1273. {                               
  1274.   int x, y;               
  1275.   for( y = 0; y < maxY; y++ ) {
  1276.     int pix[maxX];     
  1277.     int same[maxX];    
  1278.     int s;             
  1279.     int left, right;   
  1280.  
  1281.     /* initialise the links */    
  1282.     for( x = 0; x < maxX; x++ )
  1283.       same[x] = x;
  1284.  
  1285.     /* calculate the links for the Z[][] object */    
  1286.     for( x = 0; x < maxX; x++ ) {
  1287.       s = separation(Z[x][y]);
  1288.       left = x - (s/2);
  1289.       right = left + s;        
  1290.       if( 0 <= left && right < maxX ){       
  1291.         { int k;                
  1292.           for(k=same[left]; k!=left && k!=right; k=same[left])
  1293.             if( k < right ) 
  1294.               left = k;
  1295.             else {
  1296.               left = right;
  1297.               right = k;
  1298.             }
  1299.           same[left] = right; 
  1300.         }
  1301.       }
  1302.     }
  1303.  
  1304.     /* assign the colors */
  1305.     for( x = maxX-1; x >= 0; x-- ) {
  1306.       if( same[x] == x ) pix[x] = random()&1;
  1307.       else pix[x] = pix[same[x]]; 
  1308.       Set_Pixel(x, y, pix[x]);
  1309.     }
  1310.   }
  1311. }
  1312.  
  1313.  
  1314.  
  1315. Subject: [22] Creation of SIS
  1316. =============================
  1317.  
  1318. kindly written by Pascal Massimino (massimin@clipper.ens.fr)
  1319.  
  1320. (As opposed to Subject21, where the creation of a SIRDS was based
  1321. on a bitmap, here we have a ray-tracing approach. ftp the RaySIS
  1322. program) 
  1323.  
  1324. The first step in the generation of a SIS (Single Image Stereogram)
  1325. is to transform the scene you want to render into a depth field.
  1326. One interesting method is to scan your screen line by line and
  1327. intersect objects with one ray (say using a ray-tracing assimilated
  1328. method). But you can also slice your scene if it appears more
  1329. convenient. A proper rescaling of your depth may also be useful
  1330. when objects extend to far from (or to close to) the eyes, for this
  1331. could make your SIS hard to be seen when finished. 
  1332.  
  1333. Once you've got your depth field, this 3D information requires
  1334. been encoded in the SIS using a repetitive pattern. You will need
  1335. to set proper pixels to the same color, this color being taken from
  1336. an initial pattern. The following sketch shows the pixels (marked
  1337. with 'o') on the screen that will need be allocated with the same
  1338. color. The initial ray is the one (passing right in the middle of
  1339. your eyes) that was used to determine h, the depth related to the
  1340. scanned pixel (*). Then, from the point of intersection, two rays
  1341. have been drawn in the direction of the eyes. They determine
  1342. position of the linked pixels 'o', separated by a distance dx. 
  1343.  
  1344.                              initial
  1345.                                ray      
  1346.                                 |
  1347.         Eyes:        Left       |      Right
  1348.                        +<-------ES------>+            ES=eye separation
  1349.                         \       |       /
  1350.                          \   dx |      /
  1351.                           \ <---|---> /
  1352. Screen --------------------o----*----o-------------------
  1353.                          ^  \   |   /     ^
  1354.                          |   \  |  /      |
  1355.                         h|    \ | /       |
  1356.                          |     \|/        |H
  1357.                          -    ****        |
  1358.                           ***********     -
  1359. -------------------------*** object **--------- average plane
  1360.                         **************          in your scene
  1361.                       *****************
  1362.  
  1363.  
  1364. In your scene you must have a virtual average plane: every point
  1365. laying on this plane will produce two pixels separated by a
  1366. distance X on the screen, with X being the width of the initial
  1367. pattern. This method is non-linear: dx/X*(ES-X)/(ES-dx)=h/H. One
  1368. can nevertheless approximate this relation to the linear one:
  1369. dx/X=h/H without your brain getting injured...
  1370.  
  1371. This operation needs been repeated for each pixel of the scan line
  1372. to produce a field of distances dx. The hard part still remains
  1373. intact: deform this pattern to match the correlations inherent in
  1374. the formation of the 3D image. 
  1375.  
  1376. Propagation/deformation: 
  1377.  
  1378. The initial pattern is drawn, say, on the left of the screen. Then,
  1379. every pixel of this pattern is redrawn at distance dx, on the right,
  1380. and re-use the new pattern it produces as initial pattern, etc... 
  1381.  
  1382.    initial    new pattern   ....     ......
  1383.    pattern    after 1st
  1384.               deformation
  1385.               (larger)
  1386.             2            2'        2''
  1387.   1          1'           1''    
  1388.   +---------*+-----------*+--------*--------------- ...
  1389.   |         /           / 
  1390.   |  dx    /|    dx    /
  1391.   +-->----/ +---->>---/
  1392.  
  1393. Point 1 goes to 1', which himself is mapped to point 1'', etc... 
  1394.  
  1395. Problem: 
  1396.  
  1397. The field dx may present discrepancies, discontinuities, due to
  1398. objects edges, sides, etc... In the point where this occur are
  1399. actually points that, in real vision, are only seen with ONE eye (eg.
  1400. if your directive eye is looking just in the center of a small box,
  1401. one side of this box will be seen by the other eye, only). They
  1402. produce gaps or overlappings in the pattern deformation/
  1403. propagation. But you can ignore this overlapping or fill the gaps
  1404. with what you want (the initial pattern for instance),for this
  1405. points does not take part of the 3D-effect. As a drawback, this
  1406. can cause ghost-objects to appear when you are not focusing on
  1407. the right distance (that is: the angle between your eyes' sight
  1408. direction is *nearly* good, but your lens did not catch the right
  1409. focal distance). 
  1410.  
  1411. Note: 
  1412.  
  1413. Because dx is not an integer, but a real number,interpolation of
  1414. colors is required to avoid pixel-level slices of the objects to be
  1415. generated. Scene will then appear smooth.
  1416.  
  1417. You can also start the deformation/propagation from the right or
  1418. the middle of your screen... 
  1419.  
  1420. Animation: 
  1421.  
  1422. Once you've produced stereograms (SIRDS, SIS, or SIRTS), you may
  1423. create an animation out of the them. But some problems arise: 
  1424.  
  1425. The pattern of the background is *not* fixed, because it's content
  1426. *heavily* depends on the position of the objects in your scene.
  1427. Each new frame will produce different background. There are
  1428. some methods to damp this: let a part of stereograms untouched
  1429. by deformations, free from objects, so your eyes have a stable part
  1430. to catch in the animation. This work rather well with SIS if your
  1431. using a deformation of pattern that started, for instance, from the
  1432. left: this part of the stereograms will remain the same along the
  1433. animation. 
  1434.  
  1435. A more biological problem: the brain is not used to see objects
  1436. moving without the textures, that *seem* tied to the object,
  1437. moving with it. Especially with SIS, the objects rather appear to be
  1438. moving under a colored piece of sheet than in front of you, but
  1439. this is just a matter of acclimatization. Do you remember the first
  1440. time you saw a stereogram ? 
  1441.  
  1442. There still remains a mean to temper this effect: in fact, to gain
  1443. the third dimension in your image, you dropped one degree of
  1444. freedom (colors). But there still remains some latitude in the
  1445. choice of the pattern you use. You can choose any colors you
  1446. want in a pre-definite vertical strip of your stereogram. So, why
  1447. don't you choose a 'pattern' which is, for instance, a classicaly
  1448. ray-traced image of your object, whose horizontal position can be
  1449. adjust to superimpose and match your object when the 3D-effect
  1450. will take place ? The only restriction is that your object does not
  1451. extend to much beyond the strip, for only a part of width less
  1452. than X can be color-controlled by this mean. 
  1453.  
  1454.  
  1455.  
  1456. Subject: [23] Multiple stereograms
  1457. ==================================
  1458.  
  1459. Is it possible to generate a stereogram such that the image is
  1460. dependent on the viewing rotation? 
  1461.  
  1462. The short answer is YES! In a "normal" stereogram the constraints
  1463. are only in the horizontal direction, but by assigning constraints
  1464. in 2-dimensions instead of linearly across the image, it is
  1465. possible. I believe the first time I saw this was an image by Tyler
  1466. [to be referenced]. 
  1467.  
  1468. --comment by John Olsen to Andrew Steer(follows)
  1469. >Also I think it should be possible to create a stereogram which
  1470. gives
  1471. >TWO images: one when viewed landscape and another when
  1472. looked at
  1473. >portrait. It would however only be possible for certain patterns
  1474. >and NOT in general (your average real image or logo).
  1475.  
  1476. Typically, you can only do a small image, entirely contained in the
  1477. first copy of the random buffer (50 pixels wide in your case). The
  1478. "vertical" image is repeated, but it gets more and more distorted
  1479. as you go across the page. 
  1480.  
  1481. There are, as you say, limited things you can do which cover
  1482. greater areas, but the limitations are rather severe. The quality of
  1483. the results depends on how much error you're willing to put up
  1484. with, as "fog" and uncertainty in the resulting image if you want
  1485. both vertical and horizontal to be full page images. 
  1486.  
  1487. Can you "tile" or "wallpaper" stereograms? 
  1488.  
  1489. --from the net
  1490. Some people say YES!, others say NO! 
  1491.  
  1492. What do I mean? Assume we have an image that looks like 
  1493.  
  1494. +----+
  1495. |    |
  1496. | X  |
  1497. |    |
  1498. |    |
  1499. +----+
  1500.  
  1501. can the colours be assigned such that copies of the image can be
  1502. placed adjacent to the original image like this: 
  1503.  
  1504. +----+----+----+----+----+
  1505. |    |    |    |    |    |
  1506. | .  | .  | .  | .  | .  |
  1507. |    |    |    |    |    |
  1508. |    |    |    |    |    |
  1509. +----+----+----+----+----+
  1510. |    |    |    |    |    |
  1511. | .  | .  | X  | .  |etc.|
  1512. |    |    |    |    |    |
  1513. |    |    |    |    |    |
  1514. +----+----+----+----+----+
  1515. |    |    |    |    |    |
  1516. | .  | .  | .  |etc.|etc.|
  1517. |    |    |    |    |    |
  1518. |    |    |    |    |    |
  1519. +----+----+----+----+----+
  1520.  
  1521. so that there appears to be a *continuous* 3D surface? 
  1522.  
  1523. Is it possible to see two *completely* different images by
  1524. alternating between the "wall-eyed" and "cross-eyed"
  1525. techniques? 
  1526.  
  1527. Most definately! The problem that is encountered is if we want
  1528. two different images to be seen, each pixel on the stereogram
  1529. corresponds to *two* different positions, this is a form of 3D
  1530. aliasing which people refer to as "fog" -- or more plainly "hard to
  1531. see". Using a method that creates links between corresponding
  1532. pixels in the image (such as the one in Subject 21) the links
  1533. simply need to be updated for each 3D object.
  1534.  
  1535. People have tried a simple method to ameliorate this; when
  1536. generating the stereogram alternate using a pixel for the
  1537. wall-eyed or cross-eyed approaches, this will at least half the
  1538. horizontal resolution. [Has anyone tried this alternating
  1539. technique?]
  1540.  
  1541.  
  1542.  
  1543. Subject: [24] Losing the color 
  1544. ===============================
  1545.  
  1546. By using complementary colors for the left and right eye, is it
  1547. possible to create a stereogram in which the 3D image "loses"
  1548. it's color and appears in greyscale? 
  1549.  
  1550. Yes! It can be done. Would anyone like to elaborate on this
  1551. matter? :-) 
  1552.  
  1553.  
  1554.  
  1555. Subject: [25] C code for windows 
  1556. =================================
  1557.  
  1558. Version I
  1559. =========
  1560.  
  1561. From: zcapl31@ucl.ac.uk (William Andrew Steer)
  1562. Newsgroups: alt.3d
  1563. Subject: Constructing SIRDS, Windows source code MK1
  1564. Summary: Most basic program to draw SIRDS, written in C++ for
  1565. Windows
  1566. Date: Tue, 31 May 1994 11:06:20 GMT
  1567.  
  1568. This is about the simplest Windows program for drawing SIRDS. It
  1569. is only bare-bones, you'll have to modify the program for
  1570. alternative depth sources, and the SIRDS is reconstructed from
  1571. scratch after every WM_PAINT message ie whenever the window is
  1572. resized or uncovered. Use CTRL+ALT+DEL to exit while it's
  1573. drawing. 
  1574.  
  1575. If you don't program in C, just look at the TMyWindow::Paint
  1576. function. You should be aware that the random(arg) function
  1577. returns an integer between 0 and arg-1. 
  1578.  
  1579. If you have Turbo C++ then make a copy of one of the example
  1580. project files in the /tcwin/owl/examples subdirectory, and copy
  1581. the program below to your /examples subdirectory. Open Turbo
  1582. C++, load the new project, and change it's contents to include
  1583. just the program below and OWL.DEF. It should then run ok. 
  1584.  
  1585. [-- later comments by Andrew Steer
  1586. I would like to stress that it uses the 'lookback' algorithm, which
  1587. has some limitations, namely:
  1588. - it assumes that the right eye looks perpendicular to the screen
  1589. while the left eye looks slightly sideways (so the rays converge),
  1590. when in reality both eyes should look inwards. This causes
  1591. asymmetry in the image (which according to some sources makes
  1592. it more difficult for some people to see) and results in near
  1593. objects appearing marginally further right than far ones.] 
  1594.  
  1595. // ObjectWindows SIRDS Program  (C) W.A. Steer 1994
  1596.  
  1597. // Simplest routine possible
  1598.  
  1599.  
  1600. // Picture not stored
  1601. // - is completely redrawn for each WM_PAINT
  1602.  
  1603. #include <owl.h>
  1604. #include <math.h>
  1605.  
  1606. const pattwidth=96;  // the basic repeat distance.
  1607. // On a 14" monitor and 640x512 display, 96 pixels
  1608. // represents about half the distance between the eyes.
  1609.                      
  1610. const NumColors=4;
  1611.  
  1612.  
  1613. // Define the colors to use in form 0xbbggrrL
  1614. //  0x  signifies hex notation
  1615. //  bb  blue value, gg  green value, rr  red value
  1616. //  L tells the compiler the constant is Long ie 32bit 
  1617.  
  1618. COLORREF cols[NumColors]=
  1619. {
  1620.  0x000000L,
  1621.  0x800000L,
  1622.  0xFF0000L,
  1623.  0x000080L
  1624. };
  1625.  
  1626.  
  1627.  
  1628. // ----------------  TMyWindow  ----------------
  1629.  
  1630. class TMyWindow : public TWindow
  1631. {
  1632. public:
  1633.  TMyWindow( PTWindowsObject AParent, LPSTR ATitle);
  1634.  
  1635.  virtual void Paint( HDC PaintDC, PAINTSTRUCT& PaintInfo );
  1636. };
  1637.  
  1638.  
  1639. TMyWindow::TMyWindow( PTWindowsObject AParent, LPSTR ATitle) :
  1640.               TWindow(AParent, ATitle)
  1641. {
  1642.  Attr.W=620;  // Set the default window size to 620x340
  1643.  Attr.H=330;
  1644. }
  1645.  
  1646.  
  1647. void TMyWindow::Paint(HDC PaintDC, PAINTSTRUCT& )
  1648. {
  1649.  int pixels[700];
  1650.  
  1651.  int x,y;
  1652.  int h;    // height of 'features' above the background
  1653.  int l,pl; // lookback and previous lookback distances
  1654.  
  1655.  long r,s; // temporary storage for constructing sphere
  1656.  
  1657.  
  1658.  for (y=0; y < 300; y++)
  1659.  {
  1660.   for (x=0; x < pattwidth; x++)
  1661.   {
  1662.    pixels[x]=random(NumColors);
  1663.   }
  1664.  
  1665.   pl=pattwidth;
  1666.  
  1667.   for (x=pattwidth; x < 612; x++)
  1668.   {
  1669.    h=0; // by default the image is flush with the background
  1670.  
  1671.    // Calculate the height of a point on the sphere
  1672.    if ((y >= 36) && (y <= 164))
  1673.    {
  1674.     r=64*64-(y-100L)*(y-100L);
  1675.     if (r > 0)
  1676.     {
  1677.      s=r-(x-256L)*(x-256L);
  1678.      if (s > 0) h=sqrt(s)+64;
  1679.     }
  1680.    }
  1681.  
  1682.    // Calculate the lookback distance
  1683.    l=(int)(pattwidth-h/8.0+0.5);
  1684.  
  1685.    // if image has got deeper (new lookback is greater
  1686.    //  than old lookback distance) generate a new pixel,
  1687.    // otherwise repeat an old one
  1688.    if (l > pl)
  1689.     pixels[x]=random(NumColors);
  1690.    else
  1691.     pixels[x]=pixels[x-l];
  1692.  
  1693.    pl=l;
  1694.   }
  1695.  
  1696.   // Copy the image to screen
  1697.   for (x=0; x < 612; x++)
  1698.   {
  1699.    // use the colors defined at the top in cols[]
  1700.    SetPixel(PaintDC,x,y,cols[pixels[x]]);
  1701.   }
  1702.  }
  1703. }
  1704.  
  1705.  
  1706.  
  1707. // ----------------  TMyApp  ----------------
  1708.  
  1709. class TMyApp : public TApplication
  1710. {
  1711. public:
  1712.  TMyApp(LPSTR AName, HINSTANCE hInstance, HINSTANCE hPrevInstance,
  1713.    LPSTR lpCmdLine, int nCmdShow)
  1714.    : TApplication(AName, hInstance, hPrevInstance, lpCmdLine, nCmdShow) {};
  1715.  
  1716.  virtual void InitMainWindow();
  1717. };
  1718.  
  1719.  
  1720. void TMyApp::InitMainWindow()
  1721. {
  1722.  MainWindow = new TMyWindow(NULL, Name);
  1723. }                      
  1724.  
  1725.  
  1726. int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
  1727.   LPSTR lpCmdLine, int nCmdShow)
  1728. {
  1729.  TMyApp MyApp("Original SIRDS by W.A.Steer", hInstance, hPrevInstance,
  1730.                lpCmdLine, nCmdShow);
  1731.  MyApp.Run();
  1732.  return MyApp.Status;
  1733. }
  1734.  
  1735.  
  1736.  
  1737. Version II
  1738. ==========
  1739.  
  1740. From: zcapl31@ucl.ac.uk (William Andrew Steer) 
  1741. Newsgroups: alt.3d
  1742. Subject: Windows/C++ SIRDS source code Mk.2
  1743. Summary: Minimal code to generate high quality SIRDS in
  1744. Windows
  1745. Date: Thu, 9 Jun 1994 11:06:19 GMT
  1746.  
  1747. Windows SIRDS source code MK2 (C) W.A.Steer 1994 
  1748.  
  1749. Getting the program running 
  1750.  
  1751. For Borland C++ / Turbo C++ Windows users 
  1752.  
  1753. Unless you have an complete knowledge of the whereabouts of
  1754. the various include & system files on your hard disk and other
  1755. essential parameters I suggest you do the following: 
  1756.  
  1757.  o save my program in your owl\examples\ subdirectory as
  1758.    'sirds.cpp'
  1759.  o make a copy of one of the project files in your
  1760.    owl\examples\ directory under the name 'sirds.prj' in the
  1761.    same directory 
  1762.  o load up C++, and open the new 'sirds.prj' file
  1763.  o remove from it all the files other than 'owl.def' 
  1764.  o select project|add item and add my program, 'sirds.cpp' 
  1765.  o Try to run the program!!!
  1766.  
  1767. YOU MUST BE RUNNING WINDOWS IN AT LEAST 256 COLORS
  1768. otherwise the oversampling won't work properly, and you may
  1769. only get three color output. 
  1770.  
  1771. Although the program is not short, it is still the very minimum
  1772. required to do what it does within the Windows environment.
  1773. (One day the .EXE file for an all-singing all-dancing user friendly
  1774. masterpiece *may* appear somewhere deep in cyberspace!) 
  1775.  
  1776. As supplied, the user interface is non-existent - the program
  1777. itself must be changed to alter key parameters. 
  1778.  
  1779. The pictured is redrawn from scratch on every WM_PAINT
  1780. message - which takes some time... don't be afraid to use
  1781. CTRL+ALT+DEL to abort a redraw, you'll get a blue background
  1782. and the message 'SIRDS.EXE This program has stopped
  1783. responding to the system...' press enter to accept, and the
  1784. program will be terminated. 
  1785.  
  1786. The object is defined mathematically within the program -
  1787. currently a sphere surrounded by a ring, 'Saturn-like' and a test
  1788. pattern at the top and linear depth scale - slope and large
  1789. staircase at the bottom. 
  1790.  
  1791. You can try changing the code which sets the depth for a given
  1792. point for other objects using 2D or 3D math's and/or conditions
  1793. (could be quite horrendous depending on the shape), or adapting
  1794. it to import depth information from some 3D modeling program,
  1795. suitable scientific data, or fractal code. I have created 3D
  1796. Mandelbrots, a SIRDS Scanning Tunneling Microscope (STM)
  1797. picture and have seen Atomic Force Microscope (AFM) images. 
  1798.  
  1799. As it stands the program does not have features for saving or
  1800. printing the output. You'll have to use the print-screen key to
  1801. copy to clipboard and save from there, or import to some other
  1802. package. 
  1803.  
  1804. Conversion for other languages / operating systems 
  1805.  
  1806. If you want to convert the program to run on something other
  1807. than Windows, concern yourself primarily with the
  1808. TMyWindow::Paint procedure as this contains the guts of the
  1809. program; the rest is largely Windows housekeeping. (Note that
  1810. some of the arrays are defined outside the Paint procedure
  1811. (otherwise there is a tendency to run out of stack space), the main
  1812. parameters are at the top of the program, and you will need to
  1813. program a color palette). 
  1814.  
  1815.  
  1816. // ObjectWindows SIRDS Program Mk2  (C) W.A. Steer 1994
  1817. //                              email: w.steer@ucl.ac.uk
  1818.  
  1819. // Picture not stored
  1820. // - is completely redrawn for each WM_PAINT
  1821.  
  1822. // Has saturn & rings
  1823.  
  1824. // Switch 'dohiddenrem' to TRUE to enable (slow) hidden surface removal
  1825.  
  1826. #include <owl.h>
  1827. #include <math.h>
  1828. #include <alloc.h>
  1829.  
  1830. int bkdepth=-800;       // depth of the background in pixels
  1831. long E=192;             // typical eye separation in pixels
  1832. int o=700;              // observer-screen distance in pixels
  1833. const oversam=6;        // oversampling ratio - set to 1,2,4, or 6
  1834.                         //    1 implies no oversampling
  1835. BOOL dohiddenrem=FALSE; // enable/disable SLOW hidden point removal
  1836.  
  1837. const picwidth=620;     // width of the picture in pixels
  1838. const picheight=350;    // height of picture in pixels
  1839. const NumColors=64;
  1840.  
  1841.  
  1842. // ----------------  TMyWindow  ----------------
  1843.  
  1844. class TMyWindow : public TWindow
  1845. {
  1846. private:
  1847.  int pixels[picwidth*oversam];
  1848.  int link[picwidth*oversam];
  1849.  int z[picwidth];
  1850.  HPALETTE hpal;
  1851.  
  1852. public:
  1853.  TMyWindow( PTWindowsObject AParent, LPSTR ATitle);
  1854.  ~TMyWindow();
  1855.  
  1856.  virtual void Paint( HDC PaintDC, PAINTSTRUCT& PaintInfo );
  1857. };
  1858.  
  1859.  
  1860. TMyWindow::TMyWindow( PTWindowsObject AParent, LPSTR ATitle) :
  1861.               TWindow(AParent, ATitle)
  1862. {
  1863.  Attr.W=picwidth+8;   // Set the default window size
  1864.  Attr.H=picheight+26;
  1865.  
  1866.  // Create and initialise color palette with 64 shades of blue/green
  1867.  LPLOGPALETTE pal;
  1868.  
  1869.  pal=(LPLOGPALETTE) farmalloc(sizeof(LOGPALETTE)
  1870.                           + sizeof(PALETTEENTRY) * NumColors );
  1871.  pal->palVersion = 0x300;
  1872.  pal->palNumEntries = NumColors;
  1873.  
  1874.  for(int n=0; n < NumColors; n++)
  1875.  {
  1876.   pal->palPalEntry[n].peRed   = 0; 
  1877.   pal->palPalEntry[n].peGreen = n*2;
  1878.   pal->palPalEntry[n].peBlue  = n*4;
  1879.   pal->palPalEntry[n].peFlags = PC_RESERVED;
  1880.  }
  1881.  
  1882.  hpal = CreatePalette(pal);
  1883.  farfree(pal);
  1884. }
  1885.  
  1886.  
  1887. void TMyWindow::~TMyWindow()
  1888. {
  1889.  DeleteObject(hpal);   // delete the palette
  1890. }
  1891.  
  1892.  
  1893. void TMyWindow::Paint(HDC PaintDC, PAINTSTRUCT& )
  1894. {
  1895.  int x,y;
  1896.  int h;    // height of 'features'
  1897.  int u,dx,c,xx;
  1898.  int highest;
  1899.  int separation,left,right;
  1900.  int pp;
  1901.  long xs=260,ys=150,zs=-580;
  1902.  float v;
  1903.  BOOL visible;
  1904.  
  1905.  long r,s; // temporary storage for constructing sphere
  1906.  
  1907.  HPALETTE oldPalette;
  1908.  
  1909.  oldPalette=SelectPalette(PaintDC,hpal,FALSE);
  1910.  UnrealizeObject(hpal);
  1911.  RealizePalette(PaintDC);
  1912.  
  1913.  
  1914.  for (y=0; y < picheight; y++)
  1915.  {
  1916.   for (x=0; x < picwidth*oversam; x++)
  1917.   {
  1918.    link[x]=x;
  1919.   }
  1920.  
  1921.   highest=bkdepth;
  1922.  
  1923.   for (x=0; x < picwidth; x++)
  1924.   {
  1925.    h=bkdepth; // by default, image is flush with the background
  1926.  
  1927.    // start of scene-generating code
  1928.    if ((y >= ys-64) && (y <= ys+64))
  1929.    {
  1930.     r=64*64-(y-ys)*(y-ys);
  1931.     if (r>0)
  1932.     {
  1933.      s=r-(x-xs)*(x-xs);
  1934.      if (s > 0) h=sqrt(s)+zs;
  1935.     }
  1936.    }
  1937.    s=(3*xs-5*ys+4*zs-3*x+5*y)/4;
  1938.    xx=sqrt((x-xs)*(x-xs)+(y-ys)*(y-ys)+(s-zs)*(s-zs));
  1939.    if ((xx > 80) && (xx < 120) && (s > h)) h=s;
  1940.  
  1941.    if ((y >= 8) && (y < 32)) h=((x/32)%2)*32+bkdepth;
  1942.    if ((y >= 256) && (y < 280)) h=(x/32)*16+bkdepth;
  1943.    if ((y >= 296) && (y < 320)) h=x/2+bkdepth;
  1944.    // end of scene-generating code
  1945.  
  1946.    z[x]=h;   // store the height in the array
  1947.  
  1948.    if (h > highest) highest=h;
  1949.   }
  1950.  
  1951.  
  1952.   for (x=0; x < picwidth*oversam; x++)
  1953.   {
  1954.    separation=(E*oversam*z[x/oversam])/(z[x/oversam]-o);
  1955.  
  1956.    left=x-separation/2;
  1957.    right=left+separation;
  1958.  
  1959.    if ((left >= 0) && (right < picwidth*oversam))
  1960.    {
  1961.     visible=TRUE;
  1962.  
  1963.     if (dohiddenrem)
  1964.     {
  1965.      v=2.0*(o-z[x/oversam])/E;
  1966.  
  1967.      dx=1;
  1968.      do
  1969.      {
  1970.       u=z[x/oversam]+dx*v;
  1971.       if ((z[(x+dx)/oversam]>=u) || (z[(x-dx)/oversam]>=u)) visible=FALSE;
  1972.       dx++;
  1973.      }
  1974.      while ((u <= highest) && (visible==TRUE));
  1975.     }
  1976.  
  1977.     if (visible) link[right]=left;
  1978.    }
  1979.   }
  1980.  
  1981.   pp=0;
  1982.   for (x=0; x < picwidth*oversam; x++)
  1983.   {
  1984.    if (link[x]==x)
  1985.    {
  1986.     // ensures basic pattern does not change much on a scale
  1987.       // of less than one pixel when oversampling is used 
  1988.     if ((pp%oversam)==0) c=random(NumColors);
  1989.     pixels[x]=c;
  1990.     pp++;
  1991.    }
  1992.    else
  1993.     pixels[x]=pixels[link[x]]; 
  1994.   }
  1995.  
  1996.   for (x=0; x < picwidth; x++)
  1997.   {
  1998.    xx=x*oversam;
  1999.  
  2000.  
  2001.    switch (oversam)  // use different 'filters' depending
  2002.                      // on oversampling ratio
  2003.    {
  2004.     case 1:
  2005.      c=pixels[xx];
  2006.     break;
  2007.  
  2008.     case 2:
  2009.      c=(pixels[xx]*42+(pixels[xx-1]+pixels[xx+1])*24
  2010.        +(pixels[xx-2]+pixels[xx+2])*5)/100;
  2011.     break;
  2012.  
  2013.     case 4:
  2014.      c=(pixels[xx]*26+(pixels[xx-1]+pixels[xx+1])*18
  2015.        +(pixels[xx-2]+pixels[xx+2])*12
  2016.        +(pixels[xx-3]+pixels[xx+3])*7)/100;
  2017.     break;
  2018.  
  2019.     case 6:
  2020.      c=(pixels[xx]*14+(pixels[xx-1]+pixels[xx+1])*14
  2021.        +(pixels[xx-2]+pixels[xx+2])*11
  2022.        +(pixels[xx-3]+pixels[xx+3])*8
  2023.        +(pixels[xx-4]+pixels[xx+4])*5
  2024.        +(pixels[xx-5]+pixels[xx+5])*3
  2025.        +(pixels[xx-6]+pixels[xx+6])*2)/100;
  2026.     break;
  2027.    }
  2028.  
  2029.    SetPixel(PaintDC,x,y,PALETTEINDEX(c));
  2030.   }
  2031.  }
  2032.  SelectPalette(PaintDC,oldPalette,FALSE);
  2033. }
  2034.  
  2035.  
  2036.  
  2037. // ----------------  TMyApp  ----------------
  2038.  
  2039. class TMyApp : public TApplication
  2040. {
  2041. public:
  2042.  TMyApp(LPSTR AName, HINSTANCE hInstance, HINSTANCE hPrevInstance,
  2043.    LPSTR lpCmdLine, int nCmdShow)
  2044.    : TApplication(AName, hInstance, hPrevInstance, lpCmdLine, nCmdShow) {};
  2045.  
  2046.  virtual void InitMainWindow();
  2047. };
  2048.  
  2049.  
  2050. void TMyApp::InitMainWindow()
  2051. {
  2052.  MainWindow = new TMyWindow(NULL, Name);
  2053. }                      
  2054.  
  2055.  
  2056. int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
  2057.   LPSTR lpCmdLine, int nCmdShow)
  2058. {
  2059.  TMyApp MyApp("Original SIRDS by W.A.Steer", hInstance, hPrevInstance,
  2060.                lpCmdLine, nCmdShow);
  2061.  MyApp.Run();
  2062.  return MyApp.Status;
  2063. }
  2064.  
  2065.  
  2066. HOW IT WORKS 
  2067.  
  2068. Principles of 3D Imagery 
  2069.  
  2070. ---------------------------
  2071.     xxx           xxxx
  2072.       x    xxxxxxxx    object
  2073.       xxxx*x      
  2074.           |       
  2075.          | |                            BASIC PRINCIPLE for
  2076.       L  | |  R                         3D Imagery
  2077. ........*...*.............. image plane
  2078.         |   |    
  2079.        |     |   
  2080.        |     |   
  2081.       |       |  
  2082.       |       |  
  2083.      |         |
  2084.      o         o
  2085.    L             R
  2086.  
  2087. All single-image 3D systems (eg red-green glasses 3D) work on
  2088. the principle that the left and right eyes see different features on
  2089. the image plane which the brain interprets as a 3D object (see
  2090. diagram above). The glasses ensure that each eye sees only one of
  2091. the two images (with red/green specs, the eye with the RED filter
  2092. only sees the GREEN image). Other technologies for the same
  2093. effect include polarized images/glasses (used for a few films), and
  2094. flashing left/right dark/clear LCD specs with corresponding
  2095. alternate left and right images on a computer screen. 
  2096.  
  2097. BUT with autostereograms any point for the right eye is ALSO
  2098. seen by the left eye as shown below. An interpretation must then
  2099. be made for that, so an extra point X is introduced, as a
  2100. corresponding point for the right eye. This dependence must
  2101. continue and be repeated across the entire display. 
  2102.  
  2103. ---------------------------
  2104.     xxx           xxxx
  2105.       x    xxxxxx*x    object
  2106.       xxxx*x    /|
  2107.           |    / |
  2108.          | |  /  |                      IDEAL / REAL LIFE
  2109.       L  | | /R  | X                    geometry
  2110. ........*...*....*......... image plane
  2111.         |  /|   |
  2112.        |  /  |  |
  2113.        | /   |  |
  2114.       | /     | |
  2115.       |/      | |
  2116.      |/        |
  2117.      o         o
  2118.  
  2119.    L             R
  2120.  
  2121. For the purpose of generating SIRDS it is usual to assume the
  2122. geometry below, where the eyes 'move' along the image. 
  2123.  
  2124. ---------------------------
  2125.     xxx           xxxx
  2126.       x    xxx*xxxx    object
  2127.       xxxx*x  |  
  2128.           |   || 
  2129.          | | |  | 
  2130.          | | |  |                       SIMPLIFIED geometry
  2131. ........*...*....*......... image plane
  2132.         |   |    |
  2133.        |   | |    |
  2134.        |   | |    |
  2135.       |   |   |    |
  2136.       |   |   |    |
  2137.      |   |     |    |
  2138.      o   O     o    O
  2139.  
  2140.     L   L       R    R
  2141.  
  2142.  
  2143. This Program 
  2144.  
  2145. Simplifications: 
  2146.  
  2147.  o We assume that the viewer looks STRAIGHT AT all parts of
  2148.    the image (looks along the perpendicular to the screen at all
  2149.    points on the object) as shown above.
  2150.  
  2151.    reasons: much simpler math's, no preference for a particular
  2152.    viewing point. 
  2153.  
  2154.    adverse effect: parallax error: features towards the sides get
  2155.    pulled inwards slightly. 
  2156.  
  2157.  o In this program, only one value of depth is allowed for given
  2158.    values of x & y.
  2159.  
  2160.    reasons: smaller/simpler storage requirements for the object,
  2161.    generally simpler and faster to code. 
  2162.  
  2163.    adverse effects: imperfect representation of objects behind
  2164.    narrow objects. 
  2165.  
  2166.             plan views:
  2167.  
  2168.  
  2169. background  xxxxxxxxxxxxxx    xxxxx      xxxxx   xxxxx!!!!!!xxxxx
  2170.                                                       !!!!!!
  2171.                                                       !!!!!!
  2172.                                                       !!!!!!           
  2173.                  xxxx                                 !!!!!!
  2174.  pencil         xxxxxx             x    x             x!!!!x
  2175.                  xxxx               xxxx               xxxx
  2176.  
  2177.               real scene         as stored           program's
  2178.                                                   interpretation        
  2179.  
  2180.    Clearly the data offers no information about what goes on
  2181.    behind any point defined on the scene. The only sensible
  2182.    assumption to make is that the object extends from the
  2183.    given point back to infinity (or the background).
  2184.  
  2185.    A scene where the viewer looks through the bars of a prison
  2186.    cell for example, might warrant a fuller depth description. 
  2187.  
  2188.  o The program is not capable of producing a perspective
  2189.    image, given the above limitations, although there is no
  2190.    reason why more distant parts of the image could be
  2191.    defined smaller. 
  2192.  
  2193. ----------------------------------------------------------------
  2194.  
  2195. I have adopted the following coordinate system as it seems logical
  2196. and avoids the use of floating point math which is slow. (On a
  2197. 486sx without math co-processor about 100 integer
  2198. multiplications can be performed in the time taken to do ONE
  2199. similar floating point operation (about 30 and 3000 clock cycles
  2200. respectively). When considering speed, it should be borne in mind
  2201. that merely plotting several hundred thousand pixels on the
  2202. screen takes an appreciable amount of time! 
  2203.  
  2204.      ------------------------------   background
  2205.                                   ^
  2206.                                   |
  2207.                        object     |
  2208.                   xxxxxxxx        |
  2209.               ^      /\           | background depth  bkdepth
  2210.               |     |  |          |
  2211.             d |     |  |          |
  2212.               v     |  |          v
  2213.       .............*....*...........   image plane
  2214.      separation -->|    |<--      ^
  2215.                    |    |         |
  2216.                    |    |         |
  2217.                   |      |        | observer distance  o
  2218.                   |      |        |
  2219.                   |      |        |
  2220.             eyes  o      o        v
  2221.  
  2222.                   <------>
  2223.                      E
  2224.                           
  2225.  
  2226. Similar triangles: 
  2227.    separation/d = E/(d+o) 
  2228.  
  2229.    separation = d*E/(d+o) 
  2230.  
  2231. Now let us introduce an (x,y,z) coordinate system: 
  2232.    x - distance across the screen, measured from the left 
  2233.    y - distance down the screen, measured from the top
  2234.    (unconventional but Windows and older IBM graphics
  2235.    systems go that way) 
  2236.    z - distance from the screen; negative behind the screen,
  2237.    positive in front. 
  2238.  
  2239. (mathematicians would call this an anticlockwise (unconventional)
  2240. coordinate system. If necessary we could swap the y-direction by
  2241. making the program plot the right way up (+ve upwards) but
  2242. unless the data warrants it it just adds an unnecessary
  2243. complication) 
  2244.  
  2245.    separation = z[x][y]*E/(o-z[x][y]) 
  2246.  
  2247. ----------------------------------------------------------------
  2248.  
  2249. Almost invariably we need a continuous background for the scene;
  2250. it is usually chosen to be the same distance behind the screen as
  2251. the observer is in front, enabling the observer to look at his
  2252. reflection in order to aid the correct convergence of his eyes. 
  2253.  
  2254. In general, it is best not to allow a range of depths which causes
  2255. the separation to vary by a factor of two or more since the image
  2256. can be optically misinterpreted - and difficult to see properly.
  2257. With *caution*, (basically not allowing a direct boundary between
  2258. very near and far objects, and including several slopes to guide
  2259. the eyes) you can get away with deeper pictures. 
  2260.  
  2261. For scientific images or fractals, it may be convenient to set the
  2262. z[] values as bkdepth+h where h is the height of the data. 
  2263.  
  2264. It should be noted that as the observer moves further away the
  2265. depth effect becomes stronger and vice-versa. The 'correct' depth
  2266. will only be seen when he is at the distance the image was
  2267. designed for, o - if the image is reproduced at its original size. 
  2268.  
  2269. ----------------------------------------------------------------
  2270.  
  2271. Hidden point removal 
  2272.  
  2273. It is technically incorrect to plot a stereo pair of dots
  2274. corresponding to a point on the object which is visible to only one
  2275. eye - to do so would cause an ambiguity near a change in depth. 
  2276.  
  2277. --------------------------------   background
  2278.  
  2279.                 object
  2280.        xxxxxxxxxxxx ______     
  2281.         ^      / \x      |
  2282.         |     /   xxxxx  | Dz
  2283.       d |    /  Dx \     v
  2284.         |   /   |-->\ -----
  2285.         v  /         \   ^ u
  2286. ..........*...........*..|......   image plane
  2287.          /             \
  2288.         /               \
  2289.        /                 \
  2290.       /                   \
  2291.      o        eyes         o
  2292.  
  2293. If any part of the ray to either eye goes behind a point defined as
  2294. being on the surface of the object then the ray is deemed to be
  2295. intercepted, since we defined the object to be continuous in the
  2296. z-dimension. 
  2297.  
  2298. The depth, u(x), of any point of the ray can be found by similar
  2299. triangles. 
  2300.  
  2301.    2*Dx/Dz = E/(d+o) 
  2302.  
  2303.    Dz = (2*(d+o)/E)*Dx 
  2304.  
  2305.    u(x+Dx) = d-(2*(d+o)/E)*Dx 
  2306.  
  2307. Amending for the coordinate system where depths into the screen
  2308. are negative (and hence u() is also -ve) 
  2309.  
  2310.    u(x+Dx) = z[x]+(2*(o-z[x])/E)*Dx 
  2311.  
  2312. Then if 
  2313.  
  2314.    z[x+Dx] >= u(x+Dx) 
  2315.  
  2316. is true for any value Dx up to where u() meets the image plane the
  2317. ray is intercepted - and the point is not visible to both eyes. 
  2318.  
  2319. For speed, we only need to do the test up to u(x+Dx) = height of
  2320. most prominent point on the current scan line. 
  2321.  
  2322. ----------------------------------------------------------------
  2323.  
  2324. Algorithm 
  2325.  
  2326. This version of my SIRDS program uses a symmetric algorithm
  2327. based on information given in: 
  2328.    "Displaying 3D Images: Algorithms for Single Image Random
  2329.    Dot Stereograms", a paper by H.W. Thimbleby, S. Inglis and
  2330.    I.H. Witten (available from 
  2331.    ftp://ftp.cs.waikato.ac.nz/pub/SIRDS) 
  2332.  
  2333. although I have adopted a different coordinate system. 
  2334.  
  2335. In summary: 
  2336.  
  2337. for each line (y-coordinate)
  2338. {
  2339.  for each x
  2340.  {
  2341.   link[x]=x        // link each point with itself
  2342.  }
  2343.  
  2344.  for each x-coordinate of the object
  2345.  {
  2346.   find the stereo separation corresponding to the depth of the
  2347.     object at this value of x & y, as given in the math's previously
  2348.  
  2349.   left=x-separation/2
  2350.   right=left+separation   // to reduce effects of rounding errors 
  2351.  
  2352.   if the point is visible to both eyes
  2353.    link[right]=left   // link these two points
  2354.  }
  2355.  
  2356.  for each x-coordinate
  2357.  {
  2358.   if (link[x]=x)
  2359.    generate a random colored dot
  2360.   else
  2361.    print a dot in the color of the dot at link[x]
  2362.  }
  2363. }
  2364.  
  2365. N.B. There is no geometric reason to cause a dot already linked to
  2366. be linked again, although rounding errors could create two links
  2367. to two adjacent points - in this case the latter link wins! 
  2368.  
  2369. ----------------------------------------------------------------
  2370.  
  2371. One last problem: 
  2372.  
  2373. On an ordinary computer monitor (around 70dpi), curved or
  2374. sloped surfaces in stereograms as described appear broken into
  2375. distinct planes parallel to the image plane. 
  2376.  
  2377. Examination of the geometry reveals that for usual depths, the
  2378. z-resolution is around 7 times worse than the x-resolution of the
  2379. display device. 
  2380.  
  2381. (Sheer high-definition alone won't solve the problem either: if you
  2382. were to draw for a 600dpi laser, the dots may turn out too small
  2383. to see easily) 
  2384.  
  2385. Need to introduce Z-RESOLUTION ENHANCEMENT 
  2386.  
  2387. If the stereogram is calculated at higher x-resolution - say 4
  2388. times the display resolution (I call it oversampling), and then
  2389. properly reduced for display we can lose those distracting
  2390. 'staircases'. 
  2391.  
  2392. Basically each screen point is assigned a color by means of a
  2393. weighted average of several of the calculated points. 
  2394.  
  2395. eg for 2* oversampling: 
  2396.  
  2397. calc pts        x    x    x    x    x    x    x
  2398.  
  2399. weighting           .05  .24  0.42 .24  .05
  2400.  
  2401.  mix together          \    \  |  /    /
  2402.  
  2403. screen point                   X
  2404.  
  2405. The weightings must add up to one, and a bell-shaped
  2406. distribution works quite well. 
  2407.  
  2408. The figures given were derived from a Normal (Gaussian)
  2409. distribution: 
  2410.  
  2411.  
  2412.              1          -(dx^2)/(2*S^2)
  2413.    w = --------------  e
  2414.        S * sqrt(2*PI)
  2415.  
  2416. dx is the distance from the centre of the distribution
  2417. S is the standard deviation (try S=oversam/2)
  2418. w is the (fractional) weighting factor
  2419.  
  2420. The distribution extends to +/- infinity but the weighting factors
  2421. tend to zero, so we only use the first few. 
  2422.  
  2423. In practice, it is noticeably faster to make the weightings integer
  2424. on a scale from 0 to 100, then divide the sum by 100 (remember
  2425. the speed advantage of integer math). 
  2426.  
  2427. To accurately reproduce the averaged color a display with more
  2428. than 16 colors is needed. For a simple, with a linear color series
  2429. (eg black through to blue, or red to green) in a palette it is easy to
  2430. find the in-between color reference. With more complicated
  2431. programming and/or a 16.7million color display, in-betweens for
  2432. ANY color combinations could be found. 
  2433.  
  2434. (Actually you could use fewer colors, even ordinary black and
  2435. white, by using probabilities to paint 'in-between' colors -
  2436. providing there is linear resolution to spare.) 
  2437.  
  2438. It is important that the bulk of the calculated stereogram pattern
  2439. does not contain detail smaller than one pixel as this would get
  2440. lost as the resolution is reduced for display. Hence for 4*
  2441. oversampling the colors in the basic pattern should not change
  2442. more often than every 4th point. 
  2443.  
  2444. ----------------------------------------------------------------
  2445.  
  2446. Conclusion 
  2447.  
  2448. Stereograms are a rapidly expanding business and there are very
  2449. good posters by NVision and others. Unfortunately there is also
  2450. an increasing amount of rubbish (especially on the Internet). 
  2451.  
  2452. The program offered is a basis for creating stereograms of a high
  2453. technical quality, but a good deal of artistic ability is needed to
  2454. produce aesthetically pleasing masterpieces. 
  2455.  
  2456. send all enquiries to:
  2457.    Andrew Steer (w.steer@ucl.ac.uk) ) 
  2458.  
  2459.  
  2460. Subject: [26] Use POV-RAY to build depth images?
  2461. ================================================
  2462.  
  2463. From: jolsen@nyx10.cs.du.edu (John Olsen)
  2464. Newsgroups: alt.3d
  2465. Subject: Re: Using POV-RAY to generate data for SIRDS? (Yes!
  2466. Source included.)
  2467. Date: 29 Jun 1994 21:40:13 -060
  2468. joel@wam.umd.edu (Joel M. Hoffman) writes:
  2469. [Use POV-RAY to build depth images?]
  2470.  
  2471. This comes up once eery month or so. Here's how to do it. (I just
  2472. happen to be reading news on the system containing the modified
  2473. source for a change. Stuart or Todd: Can this go in the FAQ?)
  2474.  
  2475. You need to change render.c, and should not need to hit any
  2476. other files. Insie the Trace() function, you need to replace where it
  2477. looks up colors with the already available depth information. The
  2478. full diff ("diff render.c.new render.c" assuming POV2.0) contains a
  2479. bit of other tweaking:
  2480.  
  2481. ----------------------------------------------------
  2482. 382c382
  2483. <   /* Make_Colour (Colour, 0.0, 0.0, 0.0); */
  2484. ---
  2485. >   Make_Colour (Colour, 0.0, 0.0, 0.0);
  2486. 408,414c408
  2487. <     {
  2488. <       Make_Colour ( Colour,
  2489. <                  1-((int)(Best_Intersection.Depth) % 255 ) / 255.0,
  2490. <                  1-((in)(Best_Intersection.Depth) % 255 ) / 255.0,
  2491. <                  1-((int)(Best_Intersection.Depth) % 255 ) / 255.0);
  2492. <       /* Determine_Apparent_Colour (&Best_Intersection, Colour, Ray); */
  2493. <     }
  2494. ---
  2495. >     Determine_Apparent_Colour (&Best_Intersection, olour, Ray);
  2496. 416,422c410,413
  2497. <     {
  2498. <       /* if (Frame.Fog_Distance > 0.0)
  2499. <        *Colour = Frame.Fog_Colour;
  2500. <        else
  2501. <        *Colour = Frame.Background_Colour; */
  2502. <       Make_Col, 0.0, 0.0, 0.0 );
  2503. <     }
  2504. ---
  2505. >     if (Frame.Fog_Distance > 00)
  2506. >       *Colour = Frame.Fog_Colour;
  2507. >     else
  2508. >       *Colour = Frame.Background_Colour;
  2509. -----------------------------------------------------
  2510.  
  2511.  
  2512.  
  2513. Subject: [41] Hope for the hopeless
  2514. ===================================
  2515.  
  2516. -- William C. Haga (wchaga@vela.acs.oakland.edu)
  2517.  
  2518. Being one who has used wide-eyed vision on chain link fences
  2519. ever since I was a kid, I was able to see the images in SIRDS right
  2520. away. But I've had difficulty explaining the technique to friends.
  2521. Today I had the latest Games magazine with me at my parents
  2522. house. Games is running another contest using SIRDS, so there
  2523. are three in the latest issue. This time I thought of the reflection
  2524. idea. So I opened mom's china cabinet, put the magazine against
  2525. the glass in the door, and told mom to keep looking at her own
  2526. reflection in the glass until the image appeared.
  2527.  
  2528. It took less than thirty seconds.
  2529.  
  2530. When she saw the 3d train engines, I was subjected to a squeal of
  2531. delight that I hadn't heard from her for a long time. "EEK! IT'S
  2532. COMING OUT AT ME! IS THIS EVER NEAT!". Dad tried for about a
  2533. minute but gave up.
  2534.  
  2535. About an hour later, mom and I heard a shout. We went to the
  2536. dining area, and there was dad with the magazine against the
  2537. glass in the door. "Isn't that just the most amazing thing!", said
  2538. he.
  2539.  
  2540. Later they were making jokes about teaching old dogs new tricks.
  2541.  
  2542.  
  2543.  
  2544. Subject: [42] Buying commercial programs
  2545. ========================================
  2546.  
  2547. STW_DEMO.EXE: the full package will allow RDS creation
  2548. Approx US$40
  2549. N.E.Thing Enterprises
  2550. P.O. Box 1827
  2551. Cambridge, MA 02139, USA.
  2552. Config: DOS 
  2553.  
  2554. STEREOLUSIONS: creater/render/print SIRDS
  2555. I/O Software, Inc. 
  2556. Ph: (909/483-5700 800/800-7970), USA.
  2557. Config: WINDOWS/Windows NT
  2558. (From William Saito, 3/07/94)
  2559.  
  2560. KAI's POWER TOOLS: Photoshop add-on for SIS creation
  2561. Config: MAC
  2562.  
  2563.  
  2564.  
  2565. Subject: [43] The image I see is "inverted" or "sunk-in"!
  2566. =========================================================
  2567.  
  2568. To see a stereogram you must converge your eyes in such a
  2569. fashion that each eye is looking at the corresponding pixel/dot
  2570. required to get the 3D effect.
  2571.  
  2572. If you are converging your eyes in front of the picture instead of
  2573. behind the picture, you will see the apparent image inverted.
  2574.  
  2575. This is what you should be doing:
  2576.  
  2577.     right    left
  2578.      (.)      (.)
  2579.       \        /
  2580.        |      |
  2581.        \      /
  2582.         |    |
  2583. .....pixel..pixel......(actual picture/poster)
  2584.         \    /
  2585.          |  |
  2586.          \  /
  2587.          |  |  
  2588.           \/
  2589.            |
  2590.           XX (perceived position in 3D--behind the object)
  2591.  
  2592.  
  2593. You can see that the separation between the two pixels decreases
  2594. as the 3D object moves closer towards you eyes...but if you are
  2595. seeing a "depth-inverted" image, you are probably doing this: 
  2596.  
  2597.     right    left
  2598.      (.)      (.)
  2599.       \        /
  2600.        \      /
  2601.         \    /
  2602.          \  /
  2603.           \/
  2604.           XX  (perceived position in 3D in front of the object)
  2605.           /\  
  2606.          /  \
  2607.         /    \
  2608.        /      \
  2609.       /        \ 
  2610.      /          \ 
  2611. ..pixel........ pixel......(actual picture/poster)
  2612.  
  2613.  
  2614. This is where your eyes converge before the object, and we can
  2615. see that the separation increases as the object moves closer to
  2616. your eyes. Thus when a method is made to be viewed a certain
  2617. way, and you do the opposite, you see an inverted image. 
  2618.  
  2619.  
  2620. Subject: [44] Call for stereograms
  2621. ==================================
  2622.  
  2623. From: jolsen@nyx10.cs.du.edu (John Olsen)
  2624. Newsgroups: alt.3d
  2625. Subject: Call for stereograms
  2626. Date: 26 May 1994 22:16:33 -0600
  2627.  
  2628. A stereogram distributor has asked me to post the following info.
  2629. Please don't contact me about it. Call or write (snail mail) to him.
  2630. Tell him you saw my message on the Internet.
  2631.  
  2632. ----
  2633. David Sterling, president of Sterling Crescent International, Inc. is
  2634. looking for commercial-grade stereograms to be included in books
  2635. and as postcards. He prefers groups of images to singles, and you
  2636. must be the original designer (owner of the copyright on the
  2637. image). 
  2638.  
  2639. Payment on accepted designs will be on a royalty basis. For an
  2640. upcoming book deal, he is trying to get all images submitted in
  2641. final form by the end of June. The postcard work is ongoing. 
  2642.  
  2643. I'd suggest calling him once you have a list of titles together, and
  2644. then working out how to get preview copies to him (disk, paper,
  2645. fax...). He's been distributing stereogram materials for a long time
  2646. (long for the stereogram business, anyway :^), so he's picky about
  2647. high quality, good detail, and eye-catching patterns. 
  2648.  
  2649. He is:
  2650.  
  2651.    David Sterling
  2652.    Sterling Crescent International, Inc
  2653.    PO Box 690253
  2654.    San Antonio, TX 78269, USA
  2655.    voice (210) 558-7143
  2656.    fax (210) 558-7144
  2657.  
  2658.  
  2659. This version of the SIRDS-FAQ was compiled by Stuart Inglis and
  2660. attempts to continue the previous excellent version maintained by
  2661. Todd Hale (todd_hale@novell.com). The latest version of the FAQ
  2662. is located at http://www.cs.waikato.ac.nz/~singlis/sirds.html.
  2663. Please send all modifications and/or comments to 
  2664. singlis@cs.waikato.ac.nz . 
  2665.